Measuring the contrast of an image For a project, I want to measure the contrast of a global image. 

I want to compare different images to get the image with the best contrast.
I know about the Weber contrast, but I need a normalized contrast value (in the range between 0-1 or other).

Is there a simple method to do this in openCV?
One simple way for quantification of contract that I can think of is through use of image histogram. Following is my suggestion


Compute Histogram of the Image 
From the counts compute entropy


If you just want to try it out you can use the matlab inbuilt function http://www.mathworks.ch/ch/help/images/ref/entropy.html

You can use the entropy value of the histogram as a measure of contract.