#include <stdio.h>
#include <iostream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
Mat src, srcGray, dst;
src = imread("road.jpg");
if (src.empty())
{
cout << "No Data!----------- the error of reading image." << endl;
return -1;
}
// 变为灰度图像
cvtColor(src, srcGray, CV_BGR2GRAY);
// 直方图均衡化
equalizeHist(srcGray, dst);
namedWindow("source image", CV_WINDOW_AUTOSIZE);
namedWindow("gray image", CV_WINDOW_AUTOSIZE);
namedWindow("equalize image", CV_WINDOW_AUTOSIZE);
imshow("source image", src);
imshow("gray image", srcGray);
imshow("equalize image", dst);
waitKey(0);
return 0;
}
直方图均衡化
最新推荐文章于 2019-09-10 11:47:00 发布