image is the name of abuilt-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.
Best Answer