AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.16k stars 180 forks source link

Adjusting Gamma for Contrast messes up color of image #329

Closed jcauthen78 closed 3 years ago

jcauthen78 commented 3 years ago

End Goal - Increase contrast in images without losing/destroying color, by changing Gamma value or any other suggested setting.

I've had this problem since I first re-built my AllSky4 with a RPI 4.

I'm using an ASI-120mc camera. I've also got an ASI290mc, but was unable to achieve any acceptable color balance to save my life with any Gama/Color settings, even with updated firmware, so I gave up and went back to the 120... I'd much rather be using the 290, but it feels impossible to get acceptable results. (edit)IR cut filter fixed 290 color - turned out to be IR flooding the image

On the 120, Changing the Gamma from anything other than 50 destroys any color/balance in the image. I live on the outskirts of a decent sized city (Boise, Idaho) with a solid Bortle 5 sky, and a bortle 7 light-dome immediately to the north. Right now I've got auto-gain enabled, and auto-exposure disabled (i don't like the gap between exposures). With the Auto-Gain, the sky values get too bright and wash out the stars - hence wanting to increase the contrast to bring the sky values down a little bit into a decent range.

I'm Using GUI (Love It!!!): /etc/raspap/settings_ZWO.json {"width":"0","height":"0","exposure":"10000","maxexposure":"20000","autoexposure":"0","gain":"50","maxgain":"200","autogain":"1","coolerEnabled":"0","targetTemp":"0","gamma":"50","brightness":"50","wbr":"53","wbb":"90","bin":"1","delay":"500","daytimeDelay":"1000","type":"1","quality":"95","usb":"40","filename":"image.jpg","flip":"0","text":"","extratext":"","extratextage":"600","textlineheight":"30","textx":"15","texty":"35","fontname":"0","fontcolor":"255 255 255","smallfontcolor":"0 0 255","fonttype":"0","fontsize":"7","fontline":"1","outlinefont":"0","latitude":"43.53N","longitude":"116.30W","angle":"-12","time":"1","darkframe":"0","showDetails":"1"}

My save image script is slightly modified (to overlay a transparent PNG file with various gee-wizz info) - but even with it unmodified, the problem has persisted. I'll drop a few links below to the images for references. Also - the examples below were snapped BEFORE the moon came up, so it's not auto-compensating for the added sky brightness of the moon.

(edited to try and fix links) Modified "saveImageNight.sh" examples: http://jimcauth.wwwmi3-ss11.a2hosted.com/allsky/examples/gamma-50-mod.jpg http://jimcauth.wwwmi3-ss11.a2hosted.com/allsky/examples/gamma-56-mod.jpg

Original "saveImageNight.sh" examples: http://jimcauth.wwwmi3-ss11.a2hosted.com/allsky/examples/gamma-50-original.jpg http://jimcauth.wwwmi3-ss11.a2hosted.com/allsky/examples/gamma-56-original.jpg

If there's something wrong in my JSON file, I'll gladly change & test, but from what I can see, it looks correct..

Any suggestions or troubleshooting?

p.s. I know the camera focus needs adjusted - that's tomorrow's project when the evening temps aren't so chilly.

P.s.s - I'll gladly try any troubleshooting for the ASI290mc as well - same Pi-4 and install version. (edit) no longer needed

EricClaeys commented 3 years ago

Jim, this may not be related, but not all cameras support Gamma. For example, the MC178MC doesn't support it, per the ZWO SDK. Our newer capture.cpp outputs a debug level 3 message for controls that aren't supported by the camera. It would be interesting to see if your other cameras support Gamma. Eric