Frame quality problem with two cameras feeds

Hi ,
I just want to display two videos that come from two identical cameras at the same time. Then, I want to bring the two images together to get a wider angle of view. You can see the result on the attached images.

My problem is that the second camera is always of lower quality than the first. My guess is that the graphics card is not able to generate both videos at the same time.

Is there an alternative or a solution for my problem?

Thank you very much for your help !

How does the second camera work separately?
Note that even identical cameras can provide different images, as it isn’t sure that the focus distance, exposure time, white balance etc. will match.
Try to set as many parameters manually as possible to get similar images.

Thank’s for your help kbarni !

I have to do an object segmentation for an industrial application. I just want to use segmentation using color processing. However, the white balance of the second camera seems to go off the rails quickly and never returns like the first camera image. So I now have two different color for one object and it complicate my color processing. I want to use kmeans for my segmentation because i’m suppose to have only two color on my image.

I use two very cheap cameras, but the quality is enough for my application. I can’t put just one camera because they are set under a laser marker and there’s the lens in the center of my system.

My images are the exact same in the beginning, and after like 10 seconds, the quality of the second camera gets worse and worse !

since this appears to be on windows, you could try:

capture.set(CAP_PROP_SETTINGS, 1);

to get to the camera’s global properties page, where you can disable auto-whitebalance and friends persistantly (saved in the registry)

If you are afraid of parallax effect because the off-center camera, you can do a WarpPrespective operation to correct the image - so you won’t have any problems by using a single camera.

Here’s how to do it:

  • Set up your camera off-center, but point it to the work area
  • put some markers around the work area and measure exactly their position (let’s say you have a 10cm square)
  • note the positions of the points in the image recorded by the camera (in pixels)
  • create a vector of points where you want them to be projected e.g. (0,0),(0,1000),(1000,1000),(1000,0)
  • use getPerspectiveTransform to get the transformation matrix
  • for every image, use WarpPerspective to correct the image.

Otherwise it seems to me that the quality of your cameras is not good enough for your application. Remember, the image quality doesn’t depend only on the resolution! Especially for industrial applications I strongly recommend to use industrial cameras (Basler, PointGrey, uEye, etc.) A cheap webcam won’t survive a long time.

1 Like

Wow ! I will try that for sure !

Thank’s a lot kbarni !

Very appreciated !

you’ll get timing issues. even if these cameras were identical twins, one camera might produce frames a little faster than the other.

your code must not assume that it can simply grab a frame from both cameras, do something, and repeat. the only reliable way is to have two threads, each continuously reading from its camera, and storing that frame somewhere, so you always have the most recent frame from each camera available.

the first method only works for industrial cameras because their exposure can usually be triggered manually (also from software), so they will produce frames exactly when requested.

oh, and if you plug both cameras into the same USB controller, and it’s USB 2, the second one to activate might get a LOT less bandwidth because the first one uses it all. that’ll cause poor picture quality.

Wow thank’s for your answer crackwitz ! So I guest that the best way to succeed is to simply use one camera with a little angle and correct it with a matrix. I will find how to do it !

Thanks a lot for your help guys ! I am an engineering intern so I am not very experienced in machine vision. Your help is much appreciated, thanks for your time!