我想平滑直方图.
因此我试图平滑内部矩阵cvHistogram
.
typedef struct CvHistogram
{
int type;
CvArr* bins;
float thresh[CV_MAX_DIM][2]; /* for uniform histograms */
float** thresh2; /* for non-uniform histograms */
CvMatND mat; /* embedded matrix header for array histograms */
}
Run Code Online (Sandbox Code Playgroud)
我试着像这样平滑矩阵:
cvCalcHist( planes, hist, 0, 0 ); // Compute histogram
(...)
// smooth histogram with Gaussian Filter
cvSmooth( hist->mat, hist_img, CV_GAUSSIAN, 3, 3, 0, 0 );
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用,因为cvSmooth
需要CvMat
输入而不是a CvMatND
.我不能转化CvMatND
成CvMat
(CvMatND
在我的情况下,2-DIM).
有没有人可以帮助我?谢谢.