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

Technical Source
2 min readFeb 12, 2022

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.

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.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

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')

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.