uchar *pImg=(uchar *)CI.GetBits();//得到CImage数据区地址 ps=img.ptr<uchar>(i); void MatToCImage( Mat &mat, CImage &cImage) { //create new CImage int width = mat.cols; int height = mat.rows; int channels = mat.channels(); cImage.Destroy(); //clear c
1 cv::Mat cv::Mat是一个n维矩阵类,声明在<opencv2/core/core.hpp>中. class CV_EXPORTS Mat { public: //a lot of methods … /*! includes several bit-fields: - the magic signature - continuity flag - depth - number of channels */ int flags; //! the matrix dimension