图像处理中Opencv相关函数,概念

概念:

CV_32FC1含义是32位浮点型单通道
CV_8UC3含义是8位无符号整型三通道  

cvMat:

多通道矩阵

typedef struct CvMat {
	
	int type; /* CvMat 标识 (CV_MAT_MAGIC_VAL), 元素类型和标记 */        
	int step; /* 以字节为单位的行数据长度*/
	int* refcount; /* 数据参考计数 */

	union { 
		uchar* ptr;             
		short* s;             
		int* i;             
		float* fl;             
		double* db; 
	} data; /* data 指针 */

    #ifdef __cplusplus       
	union {             
		int rows;            
		int height;        
	}; 

	union { 
		int cols;             
		int width;
	};    
    #else         
	int rows; /* 行数 */         
	int cols; /* 列数*/     
    #endif

} CvMat;

cvMatND:

多维、多通道密集数组

typedef struct CvMatND {
	
	int type; /* CvMatND 标识(CV_MATND_MAGIC_VAL), 元素类型和标号*/
	int dims; /* 数组维数 */
	int* refcount; /* 数据参考计数 */
	
	union { 
		uchar* ptr;            
		short* s;             
		int* i;            
		float* fl;             
		double* db; } 
	data; /* data 指针*/

	/* 每维的数据结构 (元素号,以字节为单位的元素之间的距离)是配套定义的 */         
	struct { 
		int size;             
		int step; 
	}         
	dim[CV_MAX_DIM];

} CvMatND;





 

猜你喜欢

转载自blog.csdn.net/weixin_40874586/article/details/79935834
今日推荐