Search code examples
c++opencvimage-processinghistogram

Is there a way to equalize the histogram of a 16-bits per sample image using OpenCV?


I am working with 16bits/sample images.
Is there a (simple) way to perform the histogram equalization of such images (converting to 8bps is not an option)?


Solution

  • equalizeHist in OpenCV takes only 8 bit data.

    but image normalization in OpenCV is not limited to 8 bit data. See its description here.In your case call to function should look like:

    normalize(src_image, dst_image, 0, 65535, NORM_MINMAX);
    

    if you are trying to improve contrast of image, first try normalization and only if this is not working try equalization. Normalization is faster and less destructive.

    refer to : http://answers.opencv.org/question/3176/improve-contrast-of-a-16u-image/