小编Mic*_*lle的帖子

如何平滑直方图?

我想平滑直方图.

因此我试图平滑内部矩阵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.我不能转化CvMatNDCvMat(CvMatND在我的情况下,2-DIM).

有没有人可以帮助我?谢谢.

c++ opencv smooth histogram

4
推荐指数
1
解决办法
5571
查看次数

标签 统计

c++ ×1

histogram ×1

opencv ×1

smooth ×1