GETSNAPSHOT timeout error after adjusting camera settings

18 次查看(过去 30 天)
Hello,
I am using a Webcam (Logitech C160) to capture Images using the Image acquisition toolbox (V 3.5) in Matlab 7.10.0.499. When ever I adjust the camera settings (brightness, exposure etc.) and try to capture an image afterwards I get a timeout error.
??? Error using ==> imaqdevice.getsnapshot at 65 A timeout occurred during GETSNAPSHOT.
Interestingly, when I run the preview window during the setting change I can see the camera changing brightness, exposure etc... and it works fine, however if I stop the preview, then start it after changing the settings the preview window stays black.
If I leave the preview window running during the change, the GETSNAPSHOT function seems to work fine. As soon as I stop the preview I get the error message again.
Running the snapshot function before the change without the preview works fine.
Any ideas would be appreciated!
Sam

回答(1 个)

Chirag Gupta
Chirag Gupta 2011-7-13
Can you try and set the trigger to Manual and then try and acquire the snapshot.
triggerconfig(vidobj, 'manual');
% change properties
start(vidobj)
snapshot = getsnapshot(vidobj);
% Call the STOP function to stop the device.
stop(vidobj)
You could also change the Timeout property of the videoinput object.
  2 个评论
Sam
Sam 2011-7-13
Thank you for your reply!
Changing the trigger does not make a difference. It still will not work.
How do you change the timeout property of the videoinput object?
Chirag Gupta
Chirag Gupta 2011-7-14
I belive TimeOut is a property in the videoinput object.
vidObj.Timeout = 15;

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by