亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cvcontours.cpp

?? 將OpenCV移植到DSP上
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
////////////////////////////////////////////////////////////////////////////////////////////  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.////  By downloading, copying, installing or using the software you agree to this license.//  If you do not agree to this license, do not download, install,//  copy or use the software.//////                 License For Embedded Computer Vision Library//// Copyright (c) 2008, EMCV Project,// Copyright (c) 2000-2007, Intel Corporation,// All rights reserved.// Third party copyrights are property of their respective owners.//// Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met:////    * Redistributions of source code must retain the above copyright notice, //      this list of conditions and the following disclaimer.//    * Redistributions in binary form must reproduce the above copyright notice, //      this list of conditions and the following disclaimer in the documentation //      and/or other materials provided with the distribution.//    * Neither the name of the copyright holders nor the names of their contributors //      may be used to endorse or promote products derived from this software //      without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY // OF SUCH DAMAGE.//// Contributors://    * Shiqi Yu (Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences)#include "_cv.h"/* initializes 8-element array for fast access to 3x3 neighborhood of a pixel */#define  CV_INIT_3X3_DELTAS( deltas, step, nch )            \    ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),  \     (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),  \     (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),  \     (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch))static const CvPoint icvCodeDeltas[8] =    { {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1} };CV_IMPL voidcvStartReadChainPoints( CvChain * chain, CvChainPtReader * reader ){    int i;    CV_FUNCNAME( "cvStartReadChainPoints" );    __BEGIN__;    if( !chain || !reader )        CV_ERROR( CV_StsNullPtr, "" );    if( chain->elem_size != 1 || chain->header_size < (int)sizeof(CvChain))        CV_ERROR_FROM_STATUS( CV_BADSIZE_ERR );    cvStartReadSeq( (CvSeq *) chain, (CvSeqReader *) reader, 0 );    CV_CHECK();    reader->pt = chain->origin;    for( i = 0; i < 8; i++ )    {        reader->deltas[i][0] = (char) icvCodeDeltas[i].x;        reader->deltas[i][1] = (char) icvCodeDeltas[i].y;    }    __END__;}/* retrieves next point of the chain curve and updates reader */CV_IMPL CvPointcvReadChainPoint( CvChainPtReader * reader ){    char *ptr;    int code;    CvPoint pt = { 0, 0 };    CV_FUNCNAME( "cvReadChainPoint" );    __BEGIN__;    if( !reader )        CV_ERROR( CV_StsNullPtr, "" );    pt = reader->pt;        ptr = reader->ptr;    if( ptr )    {        code = *ptr++;        if( ptr >= reader->block_max )        {            cvChangeSeqBlock( (CvSeqReader *) reader, 1 );            ptr = reader->ptr;        }        reader->ptr = ptr;        reader->code = (char)code;        assert( (code & ~7) == 0 );        reader->pt.x = pt.x + icvCodeDeltas[code].x;        reader->pt.y = pt.y + icvCodeDeltas[code].y;    }    __END__;    return pt;}/****************************************************************************************\*                         Raster->Chain Tree (Suzuki algorithms)                         *\****************************************************************************************/typedef struct _CvContourInfo{    int flags;    struct _CvContourInfo *next;        /* next contour with the same mark value */    struct _CvContourInfo *parent;      /* information about parent contour */    CvSeq *contour;             /* corresponding contour (may be 0, if rejected) */    CvRect rect;                /* bounding rectangle */    CvPoint origin;             /* origin point (where the contour was traced from) */    int is_hole;                /* hole flag */}_CvContourInfo;/*  Structure that is used for sequental retrieving contours from the image.  It supports both hierarchical and plane variants of Suzuki algorithm.*/typedef struct _CvContourScanner{    CvMemStorage *storage1;     /* contains fetched contours */    CvMemStorage *storage2;     /* contains approximated contours                                   (!=storage1 if approx_method2 != approx_method1) */    CvMemStorage *cinfo_storage;        /* contains _CvContourInfo nodes */    CvSet *cinfo_set;           /* set of _CvContourInfo nodes */    CvMemStoragePos initial_pos;        /* starting storage pos */    CvMemStoragePos backup_pos; /* beginning of the latest approx. contour */    CvMemStoragePos backup_pos2;        /* ending of the latest approx. contour */    char *img0;                 /* image origin */    char *img;                  /* current image row */    int img_step;               /* image step */    CvSize img_size;            /* ROI size */    CvPoint offset;             /* ROI offset: coordinates, added to each contour point */    CvPoint pt;                 /* current scanner position */    CvPoint lnbd;               /* position of the last met contour */    int nbd;                    /* current mark val */    _CvContourInfo *l_cinfo;    /* information about latest approx. contour */    _CvContourInfo cinfo_temp;  /* temporary var which is used in simple modes */    _CvContourInfo frame_info;  /* information about frame */    CvSeq frame;                /* frame itself */    int approx_method1;         /* approx method when tracing */    int approx_method2;         /* final approx method */    int mode;                   /* contour scanning mode:                                   0 - external only                                   1 - all the contours w/o any hierarchy                                   2 - connected components (i.e. two-level structure -                                   external contours and holes) */    int subst_flag;    int seq_type1;              /* type of fetched contours */    int header_size1;           /* hdr size of fetched contours */    int elem_size1;             /* elem size of fetched contours */    int seq_type2;              /*                                       */    int header_size2;           /*        the same for approx. contours  */    int elem_size2;             /*                                       */    _CvContourInfo *cinfo_table[126];}_CvContourScanner;#define _CV_FIND_CONTOURS_FLAGS_EXTERNAL_ONLY    1#define _CV_FIND_CONTOURS_FLAGS_HIERARCHIC       2/*    Initializes scanner structure.   Prepare image for scanning ( clear borders and convert all pixels to 0-1.*/CV_IMPL CvContourScannercvStartFindContours( void* _img, CvMemStorage* storage,                     int  header_size, int mode,                      int  method, CvPoint offset ){    int y;    int step;    CvSize size;    uchar *img = 0;    CvContourScanner scanner = 0;    CvMat stub, *mat = (CvMat*)_img;    CV_FUNCNAME( "cvStartFindContours" );    __BEGIN__;    if( !storage )        CV_ERROR( CV_StsNullPtr, "" );    CV_CALL( mat = cvGetMat( mat, &stub ));    if( !CV_IS_MASK_ARR( mat ))        CV_ERROR( CV_StsUnsupportedFormat, "[Start]FindContours support only 8uC1 images" );    size = cvSize( mat->width, mat->height );    step = mat->step;    img = (uchar*)(mat->data.ptr);    if( method < 0 || method > CV_CHAIN_APPROX_TC89_KCOS )        CV_ERROR_FROM_STATUS( CV_BADRANGE_ERR );    if( header_size < (int) (method == CV_CHAIN_CODE ? sizeof( CvChain ) : sizeof( CvContour )))        CV_ERROR_FROM_STATUS( CV_BADSIZE_ERR );    scanner = (CvContourScanner)cvAlloc( sizeof( *scanner ));    if( !scanner )        CV_ERROR_FROM_STATUS( CV_OUTOFMEM_ERR );    memset( scanner, 0, sizeof( *scanner ));    scanner->storage1 = scanner->storage2 = storage;    scanner->img0 = (char *) img;    scanner->img = (char *) (img + step);    scanner->img_step = step;    scanner->img_size.width = size.width - 1;   /* exclude rightest column */    scanner->img_size.height = size.height - 1; /* exclude bottomost row */    scanner->mode = mode;    scanner->offset = offset;    scanner->pt.x = scanner->pt.y = 1;    scanner->lnbd.x = 0;    scanner->lnbd.y = 1;    scanner->nbd = 2;    scanner->mode = (int) mode;    scanner->frame_info.contour = &(scanner->frame);    scanner->frame_info.is_hole = 1;    scanner->frame_info.next = 0;    scanner->frame_info.parent = 0;    scanner->frame_info.rect = cvRect( 0, 0, size.width, size.height );    scanner->l_cinfo = 0;    scanner->subst_flag = 0;    scanner->frame.flags = CV_SEQ_FLAG_HOLE;    scanner->approx_method2 = scanner->approx_method1 = method;    if( method == CV_CHAIN_APPROX_TC89_L1 || method == CV_CHAIN_APPROX_TC89_KCOS )        scanner->approx_method1 = CV_CHAIN_CODE;    if( scanner->approx_method1 == CV_CHAIN_CODE )    {        scanner->seq_type1 = CV_SEQ_CHAIN_CONTOUR;        scanner->header_size1 = scanner->approx_method1 == scanner->approx_method2 ?            header_size : sizeof( CvChain );        scanner->elem_size1 = sizeof( char );    }    else    {        scanner->seq_type1 = CV_SEQ_POLYGON;        scanner->header_size1 = scanner->approx_method1 == scanner->approx_method2 ?            header_size : sizeof( CvContour );        scanner->elem_size1 = sizeof( CvPoint );    }    scanner->header_size2 = header_size;    if( scanner->approx_method2 == CV_CHAIN_CODE )    {        scanner->seq_type2 = scanner->seq_type1;        scanner->elem_size2 = scanner->elem_size1;    }    else    {        scanner->seq_type2 = CV_SEQ_POLYGON;        scanner->elem_size2 = sizeof( CvPoint );    }    scanner->seq_type1 = scanner->approx_method1 == CV_CHAIN_CODE ?        CV_SEQ_CHAIN_CONTOUR : CV_SEQ_POLYGON;    scanner->seq_type2 = scanner->approx_method2 == CV_CHAIN_CODE ?        CV_SEQ_CHAIN_CONTOUR : CV_SEQ_POLYGON;    cvSaveMemStoragePos( storage, &(scanner->initial_pos) );    if( method > CV_CHAIN_APPROX_SIMPLE )    {        scanner->storage1 = cvCreateChildMemStorage( scanner->storage2 );    }    if( mode > CV_RETR_LIST )    {        scanner->cinfo_storage = cvCreateChildMemStorage( scanner->storage2 );        scanner->cinfo_set = cvCreateSet( 0, sizeof( CvSet ), sizeof( _CvContourInfo ),                                          scanner->cinfo_storage );        if( scanner->cinfo_storage == 0 || scanner->cinfo_set == 0 )            CV_ERROR_FROM_STATUS( CV_OUTOFMEM_ERR );    }    /* make zero borders */    memset( img, 0, size.width );    memset( img + step * (size.height - 1), 0, size.width );    for( y = 1, img += step; y < size.height - 1; y++, img += step )    {        img[0] = img[size.width - 1] = 0;    }    /* converts all pixels to 0 or 1 */    cvThreshold( mat, mat, 0, 1, CV_THRESH_BINARY );    CV_CHECK();    __END__;    if( cvGetErrStatus() < 0 )        cvFree( &scanner );    return scanner;}/*    Final stage of contour processing.   Three variants possible:      1. Contour, which was retrieved using border following, is added to         the contour tree. It is the case when the icvSubstituteContour function         was not called after retrieving the contour.      2. New contour, assigned by icvSubstituteContour function, is added to the         tree. The retrieved contour itself is removed from the storage.         Here two cases are possible:            2a. If one deals with plane variant of algorithm                (hierarchical strucutre is not reconstructed),                the contour is removed completely.            2b. In hierarchical case, the header of the contour is not removed.                It's marked as "link to contour" and h_next pointer of it is set to                new, substituting contour.      3. The similar to 2, but when NULL pointer was assigned by          icvSubstituteContour function. In this case, the function removes         retrieved contour completely if plane case and          leaves header if hierarchical (but doesn't mark header as "link").      ------------------------------------------------------------------------      The 1st variant can be used to retrieve and store all the contours from the image      (with optional convertion from chains to contours using some approximation from       restriced set of methods). Some characteristics of contour can be computed in the      same pass.            The usage scheme can look like:      icvContourScanner scanner;      CvMemStorage*  contour_storage;      CvSeq*  first_contour;      CvStatus  result;      ...      icvCreateMemStorage( &contour_storage, block_size/0 );      ...                    cvStartFindContours              ( img, contour_storage,                header_size, approx_method,                [external_only,]                &scanner );      for(;;)      {          [CvSeq* contour;]          result = icvFindNextContour( &scanner, &contour/0 );          if( result != CV_OK ) break;          // calculate some characteristics          ...      }      if( result < 0 ) goto error_processing;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产日韩av| 亚洲免费在线播放| 欧美丰满嫩嫩电影| 欧美在线不卡视频| 91福利区一区二区三区| 91官网在线观看| 欧美久久久久久久久中文字幕| 欧美无乱码久久久免费午夜一区| 91蜜桃免费观看视频| 欧洲国内综合视频| 欧美日韩国产综合草草| 欧美老女人第四色| 亚洲精品在线网站| 国产精品每日更新| 亚洲综合色噜噜狠狠| 五月天激情综合| 久久精品国产99久久6| 国产在线看一区| 成人爱爱电影网址| 91久久精品国产91性色tv | 欧美精品一区二区三区蜜桃 | 日本乱人伦aⅴ精品| 欧美日韩国产美女| 欧美成人免费网站| 亚洲欧洲精品一区二区三区不卡| 亚洲视频一区二区免费在线观看| 国产一区福利在线| www.综合网.com| 欧美性极品少妇| 欧美精品一区二区三区高清aⅴ| 久久九九久精品国产免费直播| 国产精品国产自产拍高清av王其| 性欧美疯狂xxxxbbbb| 久久疯狂做爰流白浆xx| 岛国精品一区二区| 欧美久久久久中文字幕| 国产精品精品国产色婷婷| 日日夜夜免费精品视频| 国产成人午夜电影网| 欧美日韩一区二区三区免费看| 久久久久青草大香线综合精品| 夜夜亚洲天天久久| 国产一区二区三区在线观看免费| 欧美日韩综合在线| 国产无遮挡一区二区三区毛片日本 | 在线精品亚洲一区二区不卡| 精品国产乱码久久久久久夜甘婷婷| 椎名由奈av一区二区三区| 国内外精品视频| 9191成人精品久久| 亚洲视频每日更新| 在线观看一区二区精品视频| 久久久久久9999| 日本视频中文字幕一区二区三区| 91丨九色porny丨蝌蚪| 亚洲精品在线观看网站| 水蜜桃久久夜色精品一区的特点 | 麻豆精品国产91久久久久久| 色婷婷av一区二区三区大白胸| 国产欧美一区二区在线观看| 精品在线免费观看| 欧美一区二区三区免费| 午夜精品一区在线观看| 欧洲av一区二区嗯嗯嗯啊| 亚洲婷婷国产精品电影人久久| 国产成人在线视频网站| 久久这里都是精品| 国产美女视频一区| 久久久久免费观看| 国产在线一区二区综合免费视频| 欧美成人官网二区| 久久爱www久久做| 精品成人在线观看| 国产精品一区2区| 久久中文字幕电影| 国产精品一二三| 国产精品久久夜| 色偷偷一区二区三区| 一区二区三区小说| 欧美日韩久久久一区| 亚洲bt欧美bt精品777| 欧美天堂亚洲电影院在线播放 | 精品国产乱码久久久久久1区2区| 日本欧美一区二区三区| 日韩欧美精品在线视频| 久久99精品国产.久久久久久| 日韩欧美国产午夜精品| 国模娜娜一区二区三区| 国产欧美一区二区精品性| 99久久久无码国产精品| 一区二区三区四区乱视频| 欧美性三三影院| 肉丝袜脚交视频一区二区| 日韩欧美国产电影| 成人午夜碰碰视频| 亚洲乱码中文字幕| 91精品国产综合久久精品性色| 美女mm1313爽爽久久久蜜臀| 久久久久国产精品免费免费搜索| 国产+成+人+亚洲欧洲自线| 专区另类欧美日韩| 8x福利精品第一导航| 国产盗摄女厕一区二区三区| 亚洲精品免费在线| 精品女同一区二区| 91网站在线播放| 美国欧美日韩国产在线播放| 欧美精品一区在线观看| 色婷婷av一区二区| 久久99精品国产91久久来源| 亚洲视频一二三| 精品粉嫩aⅴ一区二区三区四区| 成人网男人的天堂| 日本成人在线电影网| 国产精品久久久久久久久晋中 | 久久久久久久久久久久久久久99| 91片黄在线观看| 久久av中文字幕片| 一区二区欧美视频| 久久久久久久久久看片| 欧美午夜精品免费| 国产成人在线视频网站| 日韩高清一级片| 综合久久久久久久| 国产亚洲成av人在线观看导航| 欧美亚洲丝袜传媒另类| 成人av影院在线| 精品在线播放午夜| 午夜精品久久久久久久99樱桃| 国产精品色噜噜| 精品国产一区二区国模嫣然| 欧日韩精品视频| 91美女片黄在线| 成人做爰69片免费看网站| 久久电影网电视剧免费观看| 亚洲风情在线资源站| 国产精品久久久一本精品| 2023国产精品自拍| 91精品综合久久久久久| 欧美午夜寂寞影院| 91麻豆swag| 99国产精品久久久久| 国产精品77777| 国产精品羞羞答答xxdd| 久久精品国产精品亚洲精品| 视频一区二区国产| 亚洲人成精品久久久久久| 国产精品网曝门| 欧美激情一区二区三区| 国产日韩影视精品| 国产欧美综合在线观看第十页 | 一区二区三区四区亚洲| 亚洲欧洲精品成人久久奇米网 | 欧美视频在线观看一区二区| 91在线看国产| 91福利精品视频| 一本一本大道香蕉久在线精品| 欧美日本国产一区| 欧美日韩一区在线| 7777精品伊人久久久大香线蕉的 | 国产欧美精品一区二区三区四区| 欧美电影免费观看高清完整版在线观看 | 中文字幕中文字幕一区| 日韩毛片一二三区| 综合欧美亚洲日本| 亚洲精品国产第一综合99久久| 一区二区三区免费在线观看| 亚洲一二三区在线观看| 奇米影视一区二区三区| 蜜桃免费网站一区二区三区| 久久成人免费电影| 成人免费av网站| 欧洲精品在线观看| 日韩欧美综合一区| 国产亚洲精品久| 亚洲欧美另类小说| 亚洲小说春色综合另类电影| 男人的j进女人的j一区| 成人一二三区视频| 欧美日韩中文字幕一区二区| 欧美二区在线观看| 国产日本欧美一区二区| 夜夜揉揉日日人人青青一国产精品| 亚洲丰满少妇videoshd| 久久66热偷产精品| 99久久99精品久久久久久| 欧美美女一区二区在线观看| 欧美精品一区二区蜜臀亚洲| 蜜臀av一区二区三区| 久久爱www久久做| 99久久国产综合精品麻豆| 91麻豆精品国产无毒不卡在线观看| 欧美精品一区二区三区蜜臀| 一区二区三区在线免费播放| 国产在线播放一区| 欧美三级一区二区| 国产精品素人一区二区| 亚洲大片一区二区三区| 成人精品视频.| 精品国产一区久久|