cvCreateHist在循环中使用
for( v=point_x.begin();v!=point_x.end();v++)
{
left_right=up_down=0;
int HistogramBins1 = 256,HistogramBins2 = 256;
float HistogramRange1[2]={0,255};
float *HistogramRange_u[1]={&HistogramRange1[0]};
float HistogramRange2[2]={0,255};
float *HistogramRange_d[1]={&HistogramRange2[0]};
CvHistogram *Histogram_up=cvCreateHist(1,&HistogramBins1,CV_HIST_ARRAY,HistogramRange_u);
CvHistogram *Histogram_down=cvCreateHist(1,&HistogramBins2,CV_HIST_ARRAY,HistogramRange_d);//出错
}
每次运行到第二个直方图初始化的时候就出错,说是内存问题,为什么呢