0

I googled for this about a day.

I have 50 images, all showing the same background. Unfortunately, they are all slightly differing in brightness / intensity due to slight changes in lightning during the picture aquisition. Now I want to equalize the image's intensities so that the background of all images looks excaclty the same, with the same intensity.

How can I do this?

I found a solution with lightroom: YoutubeVid

But how does this work in OpenCV? Or with Fiji?

Update:

What I do now is:

corrfactor = (Intensity_Image1 / Intensity_Image2)
img3 = (img2.astype(np.float)*(corrfactor)).astype(np.uint8)

where Image2 is a brighter version of Image1.

This gives me almost same mean intensity values for both images, which is good. However, the images do not really look the same (left is Image1, right is an intensity corrected image of Image2): Original and Corrected Image

Bendaua
  • 331
  • 1
  • 2
  • 11
  • 2
    What if you convert to a colorspace that separates color and brightness (like YUV, Lab, etc), and shift the brightness/intensity channel of each image so they all have the same mean? Could additionally normalize by the std dev. – alkasm Jun 12 '18 at 09:20
  • @Bendaua Do you want a simple solution ? In this case, I guess shifting the average brightness could work for you. You can also go for more involved algorithms by using some feature matching on your backgrounds and solving some optimization problem to harmonize your images. – Sunreef Jun 12 '18 at 11:42
  • Maybe it is a good idea to use `cv2.equalizeHist(img)`. At least this results in more similar images. However, this methods has the disadvantage that equlization is derived from and applied to the entire image. I want the equalization to be derived from the image's background only, as the pictured object changes its intensity and as it is only the background that should stay constant in all images. – Bendaua Jun 12 '18 at 12:01
  • The linked video discusses white balance, which corrects for different illumination **color**, not different illumination intensity. If there is always a significant fraction of background showing, or you can somehow determine what is the background before applying this correction, then you can use that to correct for illumination intensity. But the best, most generic way of solving this issue is to fix your illumination and camera settings so the illumination remains constant across images. – Cris Luengo Jun 12 '18 at 12:56
  • Solutions involving average brightness are affected by the size of the foreground (the amount and size of objects covering the background), and so will not work in a general case. – Cris Luengo Jun 12 '18 at 12:57

0 Answers0