#include <iostream>
#include <opencv2\opencv.hpp>
#include <math.h>
using namespace cv;
using namespace std;
int main()
{
Mat src = imread("E:\\3.jpg",IMREAD_UNCHANGED), dst;
if (!src.data) {
cout << "failed!" << endl;
return 0;
}
namedWindow("input_image", WINDOW_AUTOSIZE);
namedWindow("output_image", WINDOW_AUTOSIZE);
cvtColor(src, src, COLOR_BGR2GRAY);
imshow("input_image", src);
dst = Mat::zeros(src.size(), src.type());
equalizeHist(src, dst);
imshow("output_image", dst);
waitKey(0);
return 0;
}