OpenCV histogram

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )


Histogram equalization equalizeHist ()

prototype

void equalizeHist(
	InputArray src,
	OutputArray dst
);

parameter

  • src : input image. It must be 8-bit image (grayscale) a single channel
  • dst : Output image

example

#include<opencv2/opencv.hpp>
using namespace cv;

#define WINDOW_NAME1 "Origin"
#define WINDOW_NAME2 "Effect"

int main()
{
	Mat srcImage=imread("M.jpg",0);
	namedWindow(WINDOW_NAME1,WINDOW_NORMAL);
	imshow(WINDOW_NAME1,srcImage);

	Mat dstIamge;
	equalizeHist(srcImage,dstIamge);
	namedWindow(WINDOW_NAME2,WINDOW_NORMAL);
	imshow(WINDOW_NAME2,dstIamge);
	waitKey();
	return 0;
}

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/sandalphon4869/article/details/94629177