function elem_type channel dim
mGet float,double 1 2
GetReal*D all 1 all
Get*D all all all
CV_MAT_ELEM all all 2
例子:
CvMat* vector = cvCreateMat( 1, 3, CV_32SC2 );
CV_MAT_ELEM( *vector, CvPoint, 0, 0 ) = cvPoint(100,100);
#define CV_ARE_TYPES_EQ(mat1, mat2) /
((((mat1)->type ^ (mat2)->type) & CV_MAT_TYPE_MASK) == 0)
#define CV_ARE_CNS_EQ(mat1, mat2) /
((((mat1)->type ^ (mat2)->type) & CV_MAT_CN_MASK) == 0)
#define CV_ARE_DEPTHS_EQ(mat1, mat2) /
((((mat1)->type ^ (mat2)->type) & CV_MAT_DEPTH_MASK) == 0)
#define CV_ARE_SIZES_EQ(mat1, mat2) /
((mat1)->height == (mat2)->height && (mat1)->width == (mat2)->width)
#define CV_IS_MAT_CONST(mat) /
(((mat)->height|(mat)->width) == 1)
/* size of each channel item,
0x124489 = 1000 0100 0100 0010 0010 0001 0001 ~ array of sizeof(arr_type_elem) */
#define CV_ELEM_SIZE1(type) /
((((sizeof(size_t)<<28)|0x8442211) >> CV_MAT_DEPTH(type)*4) & 15)
/* 0x3a50 = 11 10 10 01 01 00 00 ~ array of log2(sizeof(arr_type_elem)) */
#define CV_ELEM_SIZE(type) /
(CV_MAT_CN(type) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> CV_MAT_DEPTH(type)*2) & 3))
#define CV_PI 3.1415926535897932384626433832795
#define CV_LOG2 0.69314718055994530941723212145818
#define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t))
#ifndef MIN
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#endif
#ifndef MAX
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
/* min & max without jumps */
#define CV_IMIN(a, b) ((a) ^ (((a)^(b)) & (((a) < (b)) - 1)))
#define CV_IMAX(a, b) ((a) ^ (((a)^(b)) & (((a) > (b)) - 1)))
/* absolute value without jumps */
#ifndef __cplusplus
#define CV_IABS(a) (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0))
#else
#define CV_IABS(a) abs(a)
#endif
#define CV_CMP(a,b) (((a) > (b)) - ((a) < (b)))
#define CV_SIGN(a) CV_CMP((a),0)