Search code examples
image-processingopencvemgucv

How can I change the contrast of an image using OpenCV?


I'd like to look at the contrast of an image in a certain masked region, and reduce it if it is too great. Are there built-in functions that can help me with this? If not, what sort of algorithm should I be looking at? I assume I would be looking at/changing the value of pixels to bring them closer to the average, and perhaps average distance from the average is a good measure of initial contrast?

I am using EmguCV if that is relevant.


Solution

  • Contrast is a bit of an imprecise term in image processing - but normally you would do this by stretching/compressing the histogram