From: Nandish on
Hello,
please help me.

i have connected web cam to PC. now i wanted to display caputred images by webcam continuously. i am using following code.

vid = videoinput('winvideo');

% Configuring Parameter

set(vid,'FramesPerTrigger',200)
set(vid,'FrameGrabInterval',3)
vid.TriggerRepeat = inf;
set(vid,'LoggingMode','Memory')
%triggerconfig(vid,'manual')

imaqmem(700000000)
cnt = imaqmem;
mem_low = 100000000;
mem_left = cnt.FrameMemoryLimit - cnt.FrameMemoryUsed;
start(vid)
while(mem_left > mem_low)

if (mem_left < mem_low)
flushdata(vid);
mem_left = cnt.FrameMemoryLimit - cnt.FrameMemoryUsed;
end
% trigger(vid)
frame = getsnapshot(vid);
I = rgb2gray(frame);
imshow(I);
end
stop(vid)

To clear the memory, i am using 'flushdata' command, but it is not working when i am running the code. and thus code stops running when memory gets full.

What should i do so that past memory get deleted, so i can acquired images continuously..


Thank you.