1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
int main(.......)
{
......................
double histogram_sample[1][6]={1.0,2.0,3.0,4.0,1.0,2.0};
Mat histogram(1,6,CV_64F,(void*)histogram_sample);
int histSize = 4;
float range[] = { 1.0, 4.0 } ;
const float* histRange = { range };
bool uniform = true; bool accumulate = false;
Mat hist;
calcHist( &histogram, 1, 0, Mat(), hist, 1, &histSize, &histRange, uniform, accumulate );
cout<<"hist:"<<hist<<endl;
...........................
}
|