Mat结构

  1.   /** @overload
        @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
        by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
        associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
        formed using such a constructor, you also modify the corresponding elements of m . If you want to
        have an independent copy of the sub-array, use Mat::clone() .
        */
        Mat(const Mat& m);
    
        /** @overload
        @param rows Number of rows in a 2D array.
        @param cols Number of columns in a 2D array.
        @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
        CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
        @param data Pointer to the user data. Matrix constructors that take data and step parameters do not
        allocate matrix data. Instead, they just initialize the matrix header that points to the specified
        data, which means that no data is copied. This operation is very efficient and can be used to
        process external data using OpenCV functions. The external data is not automatically deallocated, so
        you should take care of it.
        @param step Number of bytes each matrix row occupies. The value should include the padding bytes at
        the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed
        and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
        */
        Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);
    

    由博客http://www.cnblogs.com/YiXiaoZhou/p/5910730.html可知,

  2. Mat img,  img.data就是指针。

  3. 即  unsigned char *pRGBImage,
    
  4. Mat的结构
  5. class CV_EXPORTS Mat 
    {
      public: 
        int flags;//标志位 
        int dims;//维度>=2 
        int rows,cols;//行和列或者(-1,-1),此时数组超过了2维 
        uchar * data;//矩阵数据块的指针 
        int *refcount;//指针引用计数器 
    } 

     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值