Two identitical cameras don't work at the same time in SW (emgu.cv, .net)

22 Views Asked by At

I have a problem with emgu.cv (4.4.0.4099) and .net (4.7.2) SW. When i try to use two identitical cameras in my SW one camera work stability (show normal image) but other camera don't show image but show black rectangle. I configuring camera with API DShow because Msmf inializing very slow.

First camera 'indexCamera = 0', second camera 'indexCamera = 1', part of the code is described below:

videoSource = new VideoCapture(indexCamera, VideoCapture.API.DShow);
videoSource.SetCaptureProperty(CapProp.FourCC, VideoWriter.Fourcc('M', 'J', 'P', 'G'));

Also, camera is configuring with other parameters shuch as: FrameWidth, FrameHeight, Brightness, Contrast and etc. Cameras works in different threads.

Method of event timer include code for get image, part of the code is described below:

Mat frame = videoSource.QueryFrame();
VideoSource.Stop();

How i can fix this problem or how i can do initialization faster with API backends identifier VideoCapture.API.Msmf?

With API backends identifier VideoCapture.API.Msmf this problem fades away, but initialization very slow.

I try switch off one of camera before using one of them. But this didn't help.

0

There are 0 best solutions below