float range[]={0,255};
const float* ranges[] = { range };
calcHist(&image, 1, 0, Mat(), hist, 1, &hist_size, &ranges);
float range[]={0,255};
const float* ranges[] = { range };
calcHist(&image, 1, 0, Mat(), hist, 1, &hist_size, ranges);
错误原因:ranges要求是const float**类型
同时要注意,指针数组const float* ranges[] = { range };不能定义为const float* ranges = { range };