I want to smooth a histogram.
Therefore I tried to smooth the internal matrix of 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 */
}
I tried to smooth the matrix like this:
cvCalcHist( planes, hist, 0, 0 ); // Compute histogram
(...)
// smooth histogram with Gaussian Filter
cvSmooth( hist->mat, hist_img, CV_GAUSSIAN, 3, 3, 0, 0 );
Unfortunately, this is not working because cvSmooth
needs a CvMat
as input instead of a CvMatND
. I couldn t transform CvMatND
into CvMat
(CvMatND
is 2-dim in my case).
Is there anybody who can help me? Thanks.