MATLAB: Image Acquisition – Resolution

Image Acquisition Toolboxwebcam

Hello,
I am trying to get a picture using a webcam in MatLab. I am successfully able to obtain the picture and such by using the following code:
picture = videoinput('macvideo',1);
cam_image_rgb = getsnapshot(picture);
imshow(cam_image_rgb)
By default, the resolution of the image is set to 1280×720. How would I go about changing this to 800×600? I am aware that I can do this manually by clicking on 800×600 within the toolbox; however, I cannot use the toolbox as this project cannot have any manual intervention. Therefore, I am using the code above within the .m file.

Best Answer

Okay this was much easier than I originally thought. Depending on what is visible under your camera in the actual Image Acquisition Toolbox, you can easily pick the correct resolution (assuming your camera supports it) by:
picture = videoinput('macvideo',1,'YCbCr422_1280x720');
where the 'YCbCr422_1280x720' should be changed to 'YCbCr422_800x600' or whatever your camera names it as.