OpenCV Exposure Compensation Without The Need To Stitch Images

asked 2020-01-31 12:13:42 -0500

Mohammad gravatar image

updated 2020-02-01 01:18:00 -0500

(This is a repost from StackOverflow)

I have a bunch of images that have different exposures and I want to stitch them together:

image description

OpenCV has a Stitcher example but it relies on matching features between the images and they should overlap with each other.

My images are not overlapping BUT they are connected to each other contiguously (as if I partitioned a Panorama into multiple splits) and I want to connect them together and fix their exposures.

How can I do this in OpenCV Python? At the very least the Compensator class needs:

compensator.feed(corners=corners, images=images_warped, masks=masks_warped)

images_warped could just be normal input images and masks_warped could be a 2D array of Ones but I don't know how the corners value should be given manually?

a simple example would suffice, Thanks.

Here's a link to the separate example images

edit retag flag offensive close merge delete



cv::hconcat? Those appear to be range images, why do you want to change the range values?

Der Luftmensch gravatar imageDer Luftmensch ( 2020-01-31 14:39:25 -0500 )edit

Also, please link to the StackOverflow post.

Der Luftmensch gravatar imageDer Luftmensch ( 2020-01-31 14:40:35 -0500 )edit

They are predicted images from a neural network and I want to stitch them together BUT they don't have overlapping sections and the example of OpenCV doesn't work on them. I want to put them horizontally together and remove the vertical discontinuities that form because of their different exposure settings. The OpenCV Exposure Compensator class does this and I want to use it without feature matching (which requires overlapping sections). Thanks.

Mohammad gravatar imageMohammad ( 2020-02-01 01:20:21 -0500 )edit

I added the link to StackOverflow on top of the page.

Mohammad gravatar imageMohammad ( 2020-02-01 01:22:14 -0500 )edit

You can just equalize histogram

LBerger gravatar imageLBerger ( 2020-02-01 02:40:49 -0500 )edit

I've done that, It's not as effective as Exposure Compensation algorithms and it makes the other parts of the image (usually far left and far right) to have overblown intensities...

Mohammad gravatar imageMohammad ( 2020-02-01 04:19:47 -0500 )edit

If there are no simple way to do it, the hard way would be: get histograms for just narrow strips at the neighbouring images edges, compare them and figure out a global adjustment needed, and apply it to the next image to concatenate, perhaps pixel by pixel.

mvuori gravatar imagemvuori ( 2020-02-01 05:15:55 -0500 )edit

The other option is to process overlapping tiles and then blend/merge/average the overlapping regions.

Der Luftmensch gravatar imageDer Luftmensch ( 2020-02-01 11:43:51 -0500 )edit