Problem with image acquisition beeing pretty slow
5 次查看(过去 30 天)
显示 更早的评论
Hello,
does anyone know a way to change the properties of a videosource object while the acquisition is running.
vid = videoinput('winvideo', 1, 'RGB24_2592x1944')
set(obj.vid, 'TriggerRepeat', Inf );
triggerconfig(vid,'manual');
start(vid);
...
while (true)
...
trigger(vid);
imag = getdata(vid);
...
set(vid.Source,'Focus',f); <- error; cant edit settings while acquisition is running
...
end
stop(vid);
If i want to change the exposure time or the camera focus, i have to stop the videoinput, change the settings and rerstart it again whicht takes about 2 seconds. When capturing with 10 fps, this is pretty bad...
Right now i have a dirty workaround of opening the videopreview and acquiring the images with getsnapshot.
vid = videoinput('winvideo', 1, 'RGB24_2592x1944')
preview(vid);
...
while (true)
...
imag = getsnapshot(vid);
...
set(vid.Source,'Focus',f); <- this works???
...
end
stoppreview(vid);
When this previewwindow is opened, i am able to change the settings of the videosource object on the fly without stopping the entire thing. Why is that?
And is there another better solution without opening otherwise useless windows?
0 个评论
回答(1 个)
Anchit Dhar
2014-10-16
Hello,
The device properties on the source object cannot be set while acquiring data from the device. While previewing from the device, we are not logging data and hence, the properties are set-able.
The new WEBCAM interface (introduced in R2014a) allows setting device properties while acquiring images. This can be installed through the 'USB Webcams' support package.
However, the WEBCAM interface does not support buffering or logging of data to disk/memory. The SNAPSHOT command on the WEBCAM object returns the most recent frame from the camera.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!