Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

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?

share|improve this question
2  
Can you clarify what you mean by a "global" image? –  jonsca Sep 6 '12 at 1:07
1  
The whole image –  501 - not implemented Sep 6 '12 at 8:54
1  
mhnm i thought laplace is to calculate the sharpness. –  501 - not implemented Sep 6 '12 at 19:07
1  
I have seen using Laplace in context of "local contrast". There are many definitions. It depends greatly on your application. For example, you can measure just color contrast of every pixel (distance from gray) or you can measure differences in neighboring pixels, or get some measurement from histogram, or take contrast as difference between darkest and lightest point in the image. –  Libor Sep 6 '12 at 20:39
1  
Standard deviation of pixel values is a good metric. –  Andrey Oct 30 '12 at 16:20
show 2 more comments

1 Answer

One simple way for quantification of contract that I can think of is through use of image histogram. Following is my suggestion

  1. Compute Histogram of the Image
  2. 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.