Opencv之边界跟踪

  1. 问题描述
    一般是将二值化后的图像进行边界的提取。需要说明的是这个提取不是简单的找到边界,而是按照顺序的找出来。即边界上的点是按照邻接关系依次给出。

  2. 相关算法
    (1)这里解释:
    https://blog.csdn.net/coming_is_winter/article/details/72772878
    程序实现:
    https://blog.csdn.net/hanshanbuleng/article/details/84639433
    还有Canny算法之类的一推

  3. Opencv的现有算法
    有两个函数:findContours和cvFindContours。
    前者的介绍网上有很多,后者没怎么研究,后续有需要再研究。
    (1)关于findContours介绍,有以下几个介绍的:
    (a)OPENCV轮廓提取findContours和drawContours:https://blog.csdn.net/maomao1011120756/article/details/49794997
    (b)findContours函数参数详解https://blog.csdn.net/dcrmg/article/details/51987348
    (c)轮廓提取findContours和绘制drawContourshttps://blog.csdn.net/fengye2two/article/details/79101968
    但用这个函数的时候,应该是内存处理的不够好,有很多出Bug的地方。我就遇到了内存问题,网上搜索有很多解决方案,这里列举几个。
    MFC中使用FindContours()函数使用时导致的程序崩溃问题的解决方案https://blog.csdn.net/jiangjiao4726/article/details/78997902

但我的没解决,上面的第一个应该是不对的。

最终选择了下面这位仁兄的解决方案,使用cvFindContours进行了封装。
OpenCV findContours函数崩溃的真正有效解决方案https://blog.csdn.net/amani_liu/article/details/87932141

猜你喜欢

转载自blog.csdn.net/kevinshift/article/details/88603141
今日推荐