【OpenCV】直方图均衡化

直方图均衡化

用途:用于图像增强,人脸检测,卫星遥感。

均衡化的图像只支持单通道。

完整代码

void QuickDemo::histogram_eq_demo(Mat &image) {
    
    
	Mat gray;
	cvtColor(image, gray, COLOR_BGR2GRAY);
	//直方图均衡化只支持灰度图像,不支持彩色图像。
	imshow("灰度图像", gray);
	Mat dst;
	equalizeHist(gray, dst);
	imshow("直方图均衡化演示", dst);
}

结果展示

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_44824148/article/details/120807628