Firewire image acquistion getdata slower than getsnapshot
조회 수: 3 (최근 30일)
이전 댓글 표시
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
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
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
2020년 8월 14일
Hi! You can manually set the frame rate of the video obj at the properties :
src.AcquisitionFrameRateEnable = 'True';
src.AcquisitionFrameRate = 60 ;
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!