|
Hi,
I am trying to save one image from video stream that I have from my camera.
here is my code:
////////////////////////////////////////////////////
function imagesaving
vid=videoinput('avtmatlabadaptor_r2009a',1,'F0M5_Mono8_640x480');
triggerconfig(vid,'manual');
set(vid,'FramesPerTrigger',1);
start(vid);
im=getdata(vid,1);
figure,imshow(im);
imwrite(im,'C:\Documents and Settings\mlm-ad\Desktop\M files\newimg.jpg','jpg')
end
this what I got after some secs:
/////////////////////////////////////////////////////
Error event occurred at 15:31:39 for video input object: F0M5_Mono8_640x480-avtmatlabadaptor_r2009a-1.
GETDATA timed out before FRAMES were available.
??? Error using ==> imaqdevice.getdata at 153
GETDATA timed out before FRAMES were available.
Error in ==> imagesaving at 7
im=getdata(vid,1);
I wonder how could I solve this problem. I would be grateful for your help.
Alex
|