MATLAB Answers

Firewire image acquistion getdata slower than getsnapshot

6 views (last 30 days)
Amar
Amar on 24 Apr 2013
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

  0 Comments

Sign in to comment.

Answers (1)

Till
Till on 5 Sep 2013
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

  0 Comments

Sign in to comment.