Bootstrap

OpenCV实现对图像的光照归一化处理

#include <cv.h>
#include <highgui.h>
#include <stdio.h>
#include <string>
using namespace std;
void main()
{
	int i;
	IplImage *pImageChannel[4] = {0,0,0,0};
	int count = 15;
	char *name = new char;
	while(count<=17)
	{
		string FileName = "S010_001_015942";
		itoa(count,name,10);
		FileName = FileName + name;
		FileName = FileName + string(".png");
		IplImage *pSrcImage = cvLoadImage(FileName.c_str());
		IplImage *pImage = cvCreateImage(cvGetSize(pSrcImage), pSrcImage->depth, pSrcImage->nChannels);
		if(pSrcImage)
		{
			for( i=0; i<pSrcImage->nChannels; i++)
			{
				pImageChannel[i] = cvCreateImage( cvGetSize(pSrcImage), pSrcImage->depth, 1);
			}
			// 信道分离
			cvSplit( pSrcImage, pImageChannel[0], pImageChannel[1],pImageChannel[2],NULL);
			for( i = 0; i < pImage->nChannels; i++ )
			{
				//直方图均衡化
				cvEqualizeHist
;