注:代码中使用可openCV。
#include
#include "cv.h"
#include "highgui.h"
using namespace std;
//直方图均衡化
int main()
{
IplImage *src,*dst;
IplImage *srcPrj,*dstPrj;
int width,height,widthStep;
int prjheight;
int histogram[256]={0};
int i,j;
uchar *pdata,*pdst;
src = cvLoadImage("pic.jpg",0); //读取灰度图
dst = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);
width = src->width;height = src->height;widthStep = src->widthStep;
pdata = (uchar