mardi 4 septembre 2018

Thresholding intensity of an image in python?

I want to remove reflect on some images using python. I read several ways to deal with that, for example:

  1. convert image into YUV and perform a histogram equalization on the Y channel, then convert it back to RGB.

  2. transform into HSV, remove high value (above a certain threshold) of the V channel, and merge it back together.

  3. Threshold intensity, then replace the portions of the image around saturation mask using Inpainting for example. This is taken from: https://dsp.stackexchange.com/questions/1215/how-to-remove-the-glare-and-brightness-in-an-image-image-preprocessing, where the solution is in Mathematica.

A lot of code is written in Matlab for this problem. Hence I would like to reproduce one solution in python. Solution 3) is the one I prefer, and would like to right the code in python. For this I first tried to use Mathematica code in python using some library, but did not succeed, and after all having it in python directly would be a good exercise. Hence, would someone have any clue on how to threshold intensity of an image in python? Or directly remove reflect on an image? I already saw that there is some prebuild function for the Inpainting aspect in python, just missing the first part.





Aucun commentaire:

Enregistrer un commentaire