Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 352
tomaja Avatar asked Feb 12 '14 23:02

tomaja


People also ask

Which OpenCV function is used for histogram equalization?

To equalize histograms of images by using the OpenCV function cv::equalizeHist.


1 Answers

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/

like image 84
michaeltang Avatar answered Nov 15 '22 05:11

michaeltang