0

I need to run CLAHE on a bunch of images, but there are 3 ways of doing it;

  • CLAHE on each RGB channel (RGB)
  • CLAHE on L channel (LAB)
  • CLAHE on V channel (HSV)

I've found however, that all methods work on some photos, and all methods fails on others (and by fail i mean create something worse than the original photo). I need like 99.9% accuracy, so having a 50/50 gamble whether LAB is going to produce beauty or the beast, is not ideal. So is there a way for me to make a script/algorithm look at a pictures histogram, and determine what method would create the most equalized histogram (aka. The nicest photo)

I imagine this would require an AI that we feed the unprocessed histogram as input, give it the 3 options as outputs, and reward it dependent on how flat the output histogram is.

But is there another way? cause I really don't want another AI on this project. We already have 2 xD (It's for business use, for deployment in the cloud, in case it wasn't clear yet, so it doesn't have to be super optimized)

Lynet _101
  • 41
  • 5
  • You'll have problems with RGB when the image contains saturated colors, and especially when only two of the three channels are being used. For example, a picture of the sky at sunset, where the image is dominated by deep reds and blues. The green channel will have a histogram skewed towards zero. When you equalize the green histogram, the green component will be increased throughout the image, turning reds to yellows, and blues to cyan. So one method for checking the quality of CLAHE on RGB is to convert the before and after image to LAB, and compute the error rate in the A and B channels. – user3386109 May 12 '22 at 19:34
  • If you apply what user3386109 suggested you might be able to find an error function. You can use it to optimize the proper CLAHE "method" (of the three you are using) by minimizing the error. – stateMachine May 12 '22 at 21:29

0 Answers0