是否可以计算3d直方图?即,我可以从HSV图像创建直方图,捕获色调,饱和度和值?如果可能的话,在2d的3D直方图上是否有任何好处?它会使检测对象(使用calcHist())更准确或更快吗?
我知道如何创建一个二维直方图,但它是否适用于3D?
int h_bins = 50; int s_bins = 60;
int histSize[] = { h_bins, s_bins };
// hue varies from 0 to 179, saturation from 0 to 255
float h_ranges[] = { 0, 180 };
float s_ranges[] = { 0, 256 };
const float* ranges[] = { h_ranges, s_ranges };
// Use the o-th and 1-st channels
int channels[] = { 0, 1 };
calcHist(&hsv, 1, channels, Mat(), hist, 2, histSize, ranges, true, false);