#ifdef__c" />

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Opencv筆記(1) 命名規則數據結構(CvMat,...)

系統 1659 0

網上搜索了很多,檢查中發現的信息劣勢,檢查源代碼

同Cv為類的開始。包含詳細的數據不(僅存儲指針)

CvMat

      typedef struct CvMat
{
    int type;
    int step;

    /* for internal use only */
    int* refcount;
    int hdr_refcount;

    union
    {
        uchar* ptr;
        short* s;
        int* i;
        float* fl;
        double* db;
    } data;
<pre name="code" class="cpp">


    
#ifdef __cplusplus union { int rows; int height; }; union { int cols; int width; };#else int rows; int cols;#endif}CvMat;

    
    
      <pre name="code" class="cpp">CV_INLINE CvMat cvMat( int rows, int cols, int type, void* data CV_DEFAULT(NULL))
{
    CvMat m;

    assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F );
    type = CV_MAT_TYPE(type);
    m.type = CV_MAT_MAGIC_VAL | CV_MAT_CONT_FLAG | type;
    m.cols = cols;
    m.rows = rows;
    m.step = m.cols*CV_ELEM_SIZE(type);
    m.data.ptr = (uchar*)data;
    m.refcount = NULL;
    m.hdr_refcount = 0;

    return m;
}

    




    
      CV_INLINE ?double ?cvmGet( const CvMat* mat, int row, int col )

{//低效率訪問!

? ? int type;





? ? type = CV_MAT_TYPE(mat->type);

? ? assert( (unsigned)row < (unsigned)mat->rows &&

? ? ? ? ? ? (unsigned)col < (unsigned)mat->cols );





? ? if( type == CV_32FC1 )

? ? ? ? return ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col];

? ? else

? ? {

? ? ? ? assert( type == CV_64FC1 );

? ? ? ? return ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col];

? ? }

}









CV_INLINE ?void ?cvmSet( CvMat* mat, int row, int col, double value )

{

? ? int type;

? ? type = CV_MAT_TYPE(mat->type);

? ? assert( (unsigned)row < (unsigned)mat->rows &&

? ? ? ? ? ? (unsigned)col < (unsigned)mat->cols );





? ? if( type == CV_32FC1 )

? ? ? ? ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = (float)value;

? ? else

? ? {

? ? ? ? assert( type == CV_64FC1 );

? ? ? ? ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = (double)value;

? ? }

}


    
    
      typedef struct CvMatND

{

? ? int type;

? ? int dims;





? ? int* refcount;

? ? int hdr_refcount;





? ? union

? ? {

? ? ? ? uchar* ptr;

? ? ? ? float* fl;

? ? ? ? double* db;

? ? ? ? int* i;

? ? ? ? short* s;

? ? } data;





? ? struct

? ? {

? ? ? ? int size;

? ? ? ? int step;

? ? }

? ? dim[CV_MAX_DIM];

}

CvMatND;


    
    
      /* Basic element of the file storage - scalar or collection: */

typedef struct CvFileNode

{

? ? int tag;

? ? struct CvTypeInfo* info; /* type information

? ? ? ? ? ? (only for user-defined object, for others it is 0) */

? ? union

? ? {

? ? ? ? double f; /* scalar floating-point number */

? ? ? ? int i; ? ?/* scalar integer number */

? ? ? ? CvString str; /* text string */

? ? ? ? CvSeq* seq; /* sequence (ordered collection of file nodes) */

? ? ? ? CvFileNodeHash* map; /* map (collection of named file nodes) */

? ? } data;

}

CvFileNode;


    




Opencv筆記(1) 命名規則數據結構(CvMat,...)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲欧美综合在线观看 | 国产精品99r8在线观看 | 四虎永久在线精品 | 欧美精品综合一区二区三区 | se色综合视频 | 99热在线免费观看 | 和日本免费不卡在线v | 久久在线观看免费视频 | 全黄h全肉边做边吃奶在线观看 | 欧美午夜精品久久久久免费视 | 欧美日韩国产成人综合在线影院 | 天天色操 | 一个色亚洲 | 四虎免费播放观看在线视频 | 国产中文字幕第一页 | 中文字幕在线观看一区二区三区 | 精品无码久久久久久久动漫 | 成人性生活免费看 | 亚洲精品一区二区三区 | 人人综合 | 手机在线中文字幕 | 777精品成人影院 | 中文字幕国产在线观看 | www.国产精品| 久久―日本道色综合久久 | 欧美一级视频免费看 | 国产成人精品cao在线 | 午夜精品久久久久久久 | 欧美日韩生活片 | 91久久亚洲精品一区二区 | 六月丁香婷婷综合 | 很黄的视频网站 | 青青国产成人久久91 | 亚洲精品成人一区二区www | 亚洲第一视频在线播放 | 中文字幕日韩哦哦哦 | 欧美日韩国产最新一区二区 | 久久免费看| 婷婷开心中文字幕 | 五月月色开心婷婷久久合 | 四虎影院在线免费观看 |