http://blog.csdn.net/xiaowei_cqu/article/details/7606607#
http://blog.csdn.net/guoyk1990/article/details/8108667
void CFpOpencvTestDlg::OnBnClickedBtnStep2()
{
CString InputImagePath = "D:\\Images\\1.jpg";
CString OutputImagePath("D:\\Images\\8.jpg");
IplImage * image= cvLoadImage(InputImagePath);
IplImage* eqlimage=cvCreateImage(cvGetSize(image),image->depth,3);
//分别均衡化每个信道
IplImage* redImage =cvCreateImage(cvGetSize(image),image->depth,1);
IplImage* greenImage=cvCreateImage(cvGetSize(image),image->depth,1);
IplImage* blueImage =cvCreateImage(cvGetSize(image),image->depth,1);
cvSplit(image,blueImage,greenImage,redImage,NULL);
cvEqualizeHist(redImage,redImage);
cvEqualizeHist(greenImage,greenImage);
cvEqualizeHist(blueImage,blueImage);
//均衡化后的图像
cvMerge(blueImage,greenImage,redImage,NULL,eqlimage);
//保存图片
cvSaveImage(OutputImagePath, eqlimage);
}