1. 程式人生 > >OpenCV學習筆記_直方圖均衡化cvEqualizeHist

OpenCV學習筆記_直方圖均衡化cvEqualizeHist

#include<cv.h>
#include<highgui.h>

using namespace std;

int main(void){
	IplImage* cur;
	//將影象轉換為單通道後載入
	cur = cvLoadImage("D:\\testPic\\直方圖均衡化影象夾\\car1.jpg", CV_LOAD_IMAGE_GRAYSCALE);
	IplImage* EqualizeHist = cvCreateImage(cvGetSize(cur), cur->depth, 1);
	cvShowImage("cur", cur);
	//直方圖均衡化
	cvEqualizeHist(cur, EqualizeHist);

	cvShowImage("EqualizeHist", EqualizeHist);
	cvWaitKey(0);
	return 0;
}