Histogram equalization can enhance the contrast of an image !!!
# Include "opencv2/highgui. HPP "# include" opencv2/imgproc. HPP "# include <iostream> # include <stdio. h> using namespace CV; using namespace STD; int main (INT argc, char ** argv) {mat SRC, DST; char * source_window = "source image "; char * equalized_window = "equalized image"; // load the color image src = imread (argv [1], 1); If (! SRC. data) {cout <"Usage :. /histogram_demo <path_to_image> "<Endl; Return-1;} // converts a color image to a grayscale image cvtcolor (SRC, SRC, cv_bgr2gray ); // apply the histogram equalization function equalizehist (SRC, DST); // create a window and display the output result namedwindow (source_window, cv_window_autosize); namedwindow (equalized_window, cv_window_autosize); imshow (source_window, SRC); imshow (equalized_window, DST); // waitProgramWaitkey (0); Return 0 ;}