Snapshot timeout when two Gige videoinput objects are in the "start" state

조회 수: 4 (최근 30일)
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?

채택된 답변

Rueben Mendelsberg
Rueben Mendelsberg 2021년 11월 1일
The problem turned out to be the default video mode setting for these cameras. If unspecified in the videoinput constructor, these cameras use 'Mono12packed' format as default and this appears to cause problems.
If
vid1 = videoinput('gige',1);
is changed to
vid1 = videoinput('gige',1,'Mono8');
the problem goes away and I am able to take frames from both cameras without a problem.
The system performance is a bit better when using the adapter from FLIR. i.e.
vid1 = videoinput('mwspinnakerimaq',1,'Mono8_Mode0')

추가 답변 (1개)

David
David 2023년 11월 28일
I used gigecam() instead for the connection and this problem seemed to dissapear

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by