CV_RETR_LIST,CV_RETR_TREE,CV_RETR_EXTERNAL区别? [英] difference between CV_RETR_LIST,CV_RETR_TREE,CV_RETR_EXTERNAL?

查看:1765
本文介绍了CV_RETR_LIST,CV_RETR_TREE,CV_RETR_EXTERNAL区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的OpenCV cvFindContour功能,它有一个参数RETR_TYPE意味着retrivel类型,所以我没有得到什么的区别 CV_RETR_LIST CV_RETR_TREE CV_RETR_EXTERNAL

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, CV_RETR_TREE, CV_RETR_EXTERNAL?

推荐答案

看<一个href=\"http://opencv.itseez.com/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?#findcontours\">the为 findContours

的主要区别该被返回(给一个轮廓与下一个之间的关系)是在层级

The main difference is in the hierarchy that is returned (giving the relationship between one contour and the next).


  • CV_RETR_EXTERNAL 给外的轮廓,所以如果你有(说)一个轮廓封闭另一个(同心圆状),只有最外层中给出。

  • CV_RETR_LIST 给出了所有的轮廓和根本不屑计算等级 - 好,如果你只想要轮廓并不在意一个人是否是嵌套在另一个。

  • CV_RETR_CCOMP 给出的轮廓,并将其组织到外部和内部轮廓。每轮廓是一个对象的任一轮廓,或对象的 的另一个对象(即,孔)内的轮廓。在等级进行相应的调整。如果(说)你想找到的所有孔这可能是有用的。

  • CV_RETR_TREE 计算轮廓完整的层次。所以,你可以说,object1嵌套4级内Object2的深object3还嵌套4级深。

  • CV_RETR_EXTERNAL gives "outer" contours, so if you have (say) one contour enclosing another (like concentric circles), only the outermost is given.
  • CV_RETR_LIST gives all the contours and doesn't even bother calculating the hierarchy -- good if you only want the contours and don't care whether one is nested inside another.
  • CV_RETR_CCOMP gives contours and organises them into outer and inner contours. Every contour is either the outline of an object, or the outline of an object inside another object (i.e. hole). The hierarchy is adjusted accordingly. This can be useful if (say) you want to find all holes.
  • CV_RETR_TREE calculates the full hierarchy of the contours. So you can say that object1 is nested 4 levels deep within object2 and object3 is also nested 4 levels deep.

这篇关于CV_RETR_LIST,CV_RETR_TREE,CV_RETR_EXTERNAL区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆