Record video with web cam and get first frame of that and compare it with next frames in matlab -
how can record video webcam in matlab , take frame of , compare next frames
this code:
camvid1 = videoinput('winvideo',1,'yuy2_640x480'); subplot(211) h1 = image; axis ij preview(camvid1,h1) start(camvid1); pause(2),camfrm1=getdata(camvid1); camfrm1=rgb2gray(imread(camfrm1)); i=1:n camfrm2=getdata(camvid1); camfrm2=rgb2gray(camfrm2); bt=abs(double(camfrm2)-bouble(camfrm1));
imread used read file folder in particular compressed or uncompressed format. in case, have raw data, on can perform operations. so, try using:
camfrm1 = rgb2gray(camfrm1); this should work. there second typo:
bt = abs(double(camfrm2)-double(camfrm1));
Comments
Post a Comment