Matlab - Poor video quality

I tried to capture frames from the webcam present on my laptop, but the result that I get is reddish, greenish. I used the following code.

vid = videoinput('winvideo',1,'YUY2_320x240'); 
set(vid,'TriggerRepeat',Inf);
vid.FrameGrabInterval = 5;
vid_src = getselectedsource(vid);
set(vid_src,'Tag','motion detection setup');

figure; 

start(vid)
while(vid.FramesAcquired<=100) 
    data = getdata(vid,1);
    imshow(data);
end
stop(vid)
+3
source share

All Articles