您的位置:首页 > 运维架构

详解OpenCV中的cvCreateMat()函数

2017-03-30 20:57 477 查看
CreateImage函数

Creates an matrix header and allocates the matrix data   //创建矩阵头并分配矩阵数据。

.C:CvMat* cvCreateMat(int
rows
,int cols,int type)   //函数原型

Parameters

Rows -Numbers of rows in the matrix       //矩阵的行数

Cols   - Numbers of cols in the matrix
    //矩阵的列数

   type   - The type of the matrix elements in the form CV_<bit depth><S|U|F>C<number of channels>,where S=signed,

U=unsigned,F=float..For example ,CV_8UC1 means the elements are 8-bit unsigned and there is 1 channel,andCV_32SC2 means the elements are 32-bit signed
and there are 2 channels.

                注:这里type可以是任何预定义类型,预定义的结构如下:CV_<bit depth><S|U|F>C<number of channels>,于是,矩阵的元素可以是32位浮点型数据(CV_32FC2),或者是8位三元组的整型数据(CV_8UC3)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: