difference between CV_RETR_LIST,CV_RETR_TREE,CV_RETR_EXTERNAL?

前端 未结 2 1059
忘掉有多难
忘掉有多难 2021-01-30 17:59

I am using cvFindContour function of opencv and in it there is a parameter RETR_TYPE means retrivel type,hence I am not getting what is the difference between CV_RETR_LIST

2条回答
  •  不思量自难忘°
    2021-01-30 18:15

    From imgproc.cpp:

    //! mode of the contour retrieval algorithm
    enum RetrievalModes {
        /** retrieves only the extreme outer contours. It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for
        all the contours. */
        RETR_EXTERNAL  = 0,
        /** retrieves all of the contours without establishing any hierarchical relationships. */
        RETR_LIST      = 1,
        /** retrieves all of the contours and organizes them into a two-level hierarchy. At the top
        level, there are external boundaries of the components. At the second level, there are
        boundaries of the holes. If there is another contour inside a hole of a connected component, it
        is still put at the top level. */
        RETR_CCOMP     = 2,
        /** retrieves all of the contours and reconstructs a full hierarchy of nested contours.*/
        RETR_TREE      = 3,
        RETR_FLOODFILL = 4 //!<
    };
    

    OpenCV 2.4.13

提交回复
热议问题