Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 4615

Histogram Equalization not working

$
0
0
I am trying histogram equalization but its giving me the same image as the input. It seems like histogram equalization is having no impact. Can anyone tell where am I going wrong? private static Mat adjustBrightnessContrast(Mat srcImage){ Mat filterImage = srcImage.clone(); Imgproc.cvtColor(srcImage,filterImage,Imgproc.COLOR_BGR2YCrCb); java.util.List filterImageList = new ArrayList(3); Core.split(filterImage,filterImageList); Mat luminance = filterImageList.get(0); Imgproc.equalizeHist(luminance,luminance); filterImageList.set(0,luminance); Core.merge(filterImageList,srcImage); Imgproc.cvtColor(filterImage,srcImage, Imgproc.COLOR_YCrCb2BGR); return srcImage; } What I have done is converted the image from BGA to YCrCb format, and then performed histogram equalization on the first channel that is 0, after converting the image to `list` format. Then the Mat format I got after implement hist. eq. I replace the `list` with it. And finally `merge` the list with the sourceImage. But I am getting the same output as input. I am trying on this image as :: ![image description](/upfiles/14987831889729836.png) PS : I think I am doing some mistake in color part of the conversion as GRAYSCALED images worked properly.

Viewing all articles
Browse latest Browse all 4615


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>