Snapshot timeout when two Gige videoinput objects are in the "start" state
Show older comments
Hi,
I am trying to run two GigE cameras using the image acquisition toolbox. I am running into the same problem whether I use the videoinput object with either the general gige adapter or the one provided by FLIR (mwspinnakerimaq), as well as using the gigecam objects. I see the same behavoir with the spmd approach https://www.mathworks.com/matlabcentral/answers/388286-how-can-i-acquire-images-from-multiple-gige-cameras-using-image-acquisition-toolbox-and-parallel-com.
Basically, I can grab frames in a loop from either camera on its own no problem. However, as soon as I put both cameras in the "start" state I will get a timeout error on the getsnaphot command, even if I don't ask the second camera for a snaphot. The code below works just fine until you uncomment the indicated line.
vid1 = videoinput('gige',1);
src1 = getselectedsource(vid1);
set(src1,'ExposureAuto','off')
vid1.IgnoreDroppedFrames = 'on';
vid1.FramesPerTrigger = 1;
triggerconfig(vid1,'manual')
vid2 = videoinput('gige',2);
src2 = getselectedsource(vid2);
set(src2,'ExposureAuto','off')
vid2.IgnoreDroppedFrames = 'on';
vid2.FramesPerTrigger = 1;
triggerconfig(vid2,'manual');
start(vid1)
% start(vid2) % uncommenting this line causes the timeout error
N = 100;
tic
for ii = 1:N
frame1 = getsnapshot(vid1);
end
t = toc;
fprintf('Average Frame Rate = %.1fHz\n',N/t);
stop(vid1)
% stop(vid2)
I feel like I ran into a probelm with the image aquisition toolbox, these particular GigE cameras, or I'm missing some basic setting or something.
Any ideas?
Accepted Answer
More Answers (1)
David
on 28 Nov 2023
0 votes
I used gigecam() instead for the connection and this problem seemed to dissapear
Categories
Find more on GigE Vision Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!