#include<opencv2/opencv.hpp>
#include<iostream>
#include<vector>
using namespace std;
using namespace cv;
int main()
{
Mat srcImage = imread("1.jpg");
imshow("【原图】", srcImage);
Mat grayImage;
cvtColor(srcImage, grayImage, CV_BGR2GRAY);
imshow("【灰度图】", grayImage);
Mat dstImage;
//直方图均衡化
equalizeHist(grayImage, dstImage);
imshow("【均衡化后的灰度图】", dstImage);
Mat resImage;
cvtColor(dstImage, resImage, CV_GRAY2BGR);
srcImage.copyTo(resImage, dstImage);
imshow("【均衡化后的彩图】", resImage);
waitKey(0);
return 0;
}
opencv3直方图均衡化
最新推荐文章于 2024-09-22 22:27:06 发布