frames=2;
vid = videoinput('winvideo',1);
set(vid.source,'AnalogVideoFormat','pal_i');
set(vid,'FramesPerTrigger',frames);
start(vid);
isrunning(vid);
wait(vid,5);
isrunning(vid);
foto = getdata(vid);
delete(vid);
clear vid;
imaqmontage(foto);
foto = uint16(foto);
whos;
size(foto)
for i=1:576
for j=1:768
for n=2:frames
foto(i,j,:,1)=foto(i,j,:,1)+foto(i,j,:,n);
end
foto(i,j,:,1)=foto(i,j,:,1)/frames;
end
end
foto = uint8(foto);
image(foto(:,:,:,1))