I want to create a FIFO for real time face tracking with my webcam. To prevent a memory overflow i want to create something like a FIFO. I thought grabbing the images with „peekdata“ and releasing them with „fluemshdata“ would do the job. However cheking the memory shows that the memory used by matlab is still increasing. So what ist he best way to do that? Thank you very much.
My code so far:
imaqhwinfo
info = imaqhwinfo('winvideo',2);
try
vid = videoinput('winvideo',2,info.DefaultFormat);
catch
stop(vid);
clear vid;
vid = videoinput('winvideo',2,info.DefaultFormat);
end
vid.TriggerRepeat = Inf;
vid.FrameGrabInterval = 1;
vid.FramesPerTrigger=1;
start(vid);
while 1
frame=peekdata(vid,1);
flushdata(vid,'trigger');
memo=memory
end
flushdata(vid);
stop(vid);
delete(vid);
imaqreset;
close(gcf)