I've noticed in the O'rielly book that when using histograms it refers to a cvMatND data structure. However, the book does not explain what this data structure is used for and how its different then cvMat. Can someone please explain this to me? Thank you.
A:
Konamiman
2009-11-12 08:44:00
Hmm, so from that page I was able to see that it's multi-dimensional while cvMat is just a single dimension. Am I understanding this correctly?
Sevaj Ba
2009-11-12 08:46:31
cvMat is actually a matrix (so, it has two dimensions).
Konamiman
2009-11-12 08:53:42
+1
A:
cvMat
is two-dimensional (multi-channel) array, i.e., a matrix.
cvMatND
is an n-dimensional (multi-channel) array.
See the Basic Structures section in the CXCORE reference manual.
Update:
A histogram can be computed in arbitrary dimensions, therefore the definition of
the CvHistogram
structure uses CvMatND
to store multidimensional histograms to
a dense multidimensional array structure.
typedef struct CvHistogram
{
int type;
CvArr* bins;
float thresh[CV_MAX_DIM][2]; // for uniform histograms
float** thresh2; // for nonuniform histograms
CvMatND mat; // embedded matrix header
// for array histograms
}
CvHistogram;
rcs
2009-11-12 08:49:08
Could you please explain why you would use one over the other, I'm a newb at openCV and computer vision so this is really difficult for me to understand without an example.
Sevaj Ba
2009-11-12 08:58:57