aaronwmorris / indi-allsky

Software to manage a Linux-based All Sky Camera.
GNU General Public License v3.0
226 stars 37 forks source link

CLAHE 16 bit Processing Distorted Colors #1164

Closed HxPI closed 2 months ago

HxPI commented 7 months ago

When CLAHE is enabled with 16 bit processing, the images from my INDI camera ASI678MC set to daytime exposure settings have green patches in various places in the image. It doesn't appear to be associated with over/under exposure. Is there anything to check in settings or are there any known issues/limitations with this feature?

aaronwmorris commented 7 months ago

I have noticed the same thing. I have not figured out why that is happening. It is possible it is an overflow in one of the channels in LAB colorspace.

henrikeri commented 4 months ago

Hi @aaronwmorris have you made any progress here? Anything I can do to help investigate the issue?

aaronwmorris commented 4 months ago

Merged #1309 to fix.

This was much easier than I realized. I spent quite a bit of time trying to fix this when I first developed the algorithm, but I never saw my mistake. I calculated the max value for 16-bit numbers as 2^16, but for the purpose of calculations, it needs to be (2 ** 16) - 1 which is 65536 vs 65535