Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatic adjust color and contrast

in my project i want to implement a modul which add or remove contrast to a given picture automatically. My problem is, to find out how much contrast i can add or remove. I know about photoshops auto-contrast/auto-color function. Can someone explain me how it works or a theory/paper/idea how to implement this?

I know, there is a histogram-equalization feature. But that's not the feature i'm seeking for.

For example i want to choose one of this three gradiant-curves,which match with the image.

Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image Hosted by ImageShack.us

greetings

like image 796
501 - not implemented Avatar asked Jul 30 '12 14:07

501 - not implemented


People also ask

How do I get auto color correction?

If you would like more options, Alt-click (Mac: Option-click) the “Auto” button to bring up the “Auto Color Correction Options”, and choose from the different algorithms. In CS6 and newer, the default will be Enhance Brightness & Contrast. In older versions of Photoshop the default is Enhance Per Channel Contrast.

What is Auto contrast?

To quickly recap, Auto Contrast looks at all three color channels (Red, Green and Blue) as a single composite image and boosts overall contrast by making the darkest pixels in the image black, the lightest pixels white, and then redistributing all the other tonal values in between.


1 Answers

A simple linear way of performing "auto-contrast" is to linearly stretch and offset the image intensities. The idea is to find the stretch (contrast) and offset (intensity) correction parameters such that in the corrected image the 5th percentile will be mapped to 0, and the 95th percentile will be mapped to 255.

Check out my answer here for more details.

like image 155
Adi Shavit Avatar answered Oct 06 '22 00:10

Adi Shavit