フィルターのクリア

Firewire image acquistion getdata slower than getsnapshot

5 ビュー (過去 30 日間)
Amar
Amar 2013 年 4 月 24 日
コメント済み: Malu 2020 年 8 月 14 日
Hello,
The getdata function is working much slower than getsnapshot when I try to acquire images from my AVT marlin camera.
Example 1: If I use the getsnapshot function, the framerate is >25 fps
imaqreset
frames = 5
vid = videoinput('avtmatlabadaptor_r2009b', 1, 'F7M0_Mono8_1280x1024');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
vid.TriggerRepeat = Inf;
vid.ROIPosition = [1 1 10 10];
start(vid)
tic;
for j=1:frames
data = getsnapshot(vid);
end
tstop = toc;
framerate = frames / tstop
stop(vid)
Example 2: If instead I use the getdata function with manual triggering, the framerate slows to ~1 fps.
imaqreset
frames = 5
vid = videoinput('avtmatlabadaptor_r2009b', 1, 'F7M0_Mono8_1280x1024');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
vid.TriggerRepeat = Inf;
vid.ROIPosition = [1 1 10 10];
triggerconfig(vid,'manual');
start(vid)
tic;
for j=1:frames
trigger(vid);
data = getdata(vid);
end
tstop = toc;
framerate = frames / tstop
stop(vid)
Why is example 1 so much faster than example 2? I would think that the manual triggering would be much faster.
Thanks a lot! Amar
  1 件のコメント
Malu
Malu 2020 年 8 月 14 日
Why are you triggering inside the for loop? I think you might be overwriting the data for each, and that's why it might lower the frame rate. Plus you can also set the acquistion frame rate from the properties.
src.AcquisitionFrameRateEnable = 'True';
src.AcquisitionFrameRate = 60 ;

サインインしてコメントする。

回答 (1 件)

Till
Till 2013 年 9 月 5 日
Hi Amar,
currently, I have the exact same problem. The code I am using is basically identical to yours, with the difference that I trigger and read the video object with a timer object. I, too, get frame rates of approximately 1 fps.
Interestingly, when I use the preview function to see if the video object is working properly I can get very high frame rates.
Have you found a solution to this problem?
Best regards,
Till
  1 件のコメント
Malu
Malu 2020 年 8 月 14 日
Hi! You can manually set the frame rate of the video obj at the properties :
src.AcquisitionFrameRateEnable = 'True';
src.AcquisitionFrameRate = 60 ;

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by