MATLAB: Webcam snapshot

image acquisitionsnapshotwebcam

when i take a web cam snpshot using…
vidobj = videoinput('winvideo');
snapshot = getsnapshot(vidobj);
imagesc(snapshot)
imwrite(image,'a.bmp')
....
the image gets stored as a single pixel image ….i want a decent image of at lst 3000 pixels plz reply fas

Best Answer

image is the name of a built-in MATLAB function, so what you get with
imwrite(image, 'a.bmp');
is really not what you want. Instead, save your image array, like this:
imwrite(snapshot, 'a.bmp');
Your webcam is probably at least 648x480 resolution so you'll get way more than 3000 pixels. You could get anywhere from 307,200 pixels to millions of pixels.