我已经有一个包含图像的位图数组,现在我需要构建一个openCV对象来操作它。我所看到的唯一构造函数是:
cv::imread(fileName...);
还有哪些从现有结构创建图像的方法?
OpenCV 2.3
我已经有一个包含图像的位图数组,现在我需要构建一个openCV对象来操作它。我所看到的唯一构造函数是:
cv::imread(fileName...);
还有哪些从现有结构创建图像的方法?
OpenCV 2.3
获取数据指针、图像通道和维度,并使用其中的一个构造函数:
Mat image(width, height, CV_8UC3, ucharDataPtr);
CvMat // 2D array
|-- int type; // elements type (uchar,short,int,float,double) and flags
|-- int step; // full row length in bytes
|-- int rows, cols; // dimensions
|-- int height, width; // alternative dimensions reference
|-- union data;
|-- uchar* ptr; // data pointer for an unsigned char matrix
|-- short* s; // data pointer for a short matrix
|-- int* i; // data pointer for an integer matrix
|-- float* fl; // data pointer for a float matrix
|-- double* db; // data pointer for a double matrix
(http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html)