#include "cv。h"
#include "highgui。h"
#define HDIM 256
int main( int argc, char** argv )
IplImage *src = 0, *dst = 0;
CvHistogram *hist = 0;
int n = HDIM;
double nn[HDIM];
uchar T[HDIM];
CvMat *T_mat;
int x;
int sum = 0;
double val = 0;
src = cvLoadImage( "03。
jpg",-1); // force to gray image cvNamedWindow( "source", 1 );
cvNamedWindow( "result", 1 );
hist = cvCreateHist( 1, n, CV_HIST_ARRAY, 0, 1 );
cvCalcHist( src, hist, 0, 0 );
val = 0;
for ( x = 0; x bins, x);
nn[x] = val;
sum = src-height * src-width;
for( x = 0; x
0