詳解OpenCV中的cvCreateMat()函數

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)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章