如何删除错误检测? [英] How to remove false detections?

查看:152
本文介绍了如何删除错误检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenCV来检测二进制图像中的椭圆,如下所示。在图像中,有八个椭圆被检测。我可以使用findContours获得很多轮廓,包括八个椭圆。问题是:我怎么判断哪一个是椭圆哪一个不是?如何删除所有其他错误检测?

I am using OpenCV to detect ellipses in a binary image as shown below. In the image, there are eight ellipses to be detected. I can use findContours to obtain a lot of contours including the eight ellipses. The problem is: how can I judge and which one is ellipse which one is not? How to remove all the other false detections?


推荐答案

一个选项有点hacky:
在findContours之上使用 minEnclosingCircle 并按分钟过滤轮廓。基于阈值包围半径(移除小于半径A(移除微小的斑点)并且大于半径B(移除巨大的斑点))。您也可以尝试 minAreaRect 并检查宽高比以查找统一blob而不是高/宽。

One option is a bit hacky: On top of findContours use minEnclosingCircle and filter contours by min. enclosing radius based on a threshold value (remove smaller than radius A (remove tiny blobs) and greater than radius B( remove huge blobs)). You can also try minAreaRect and check width/height ratio to look for uniform blobs rather than tall/wide ones.

使用Hough变换的解决方案越少。看一下霍夫圈和教程

The less hacky solution is to use Hough transforms. Have a look at the hough circle and the tutorial

这篇关于如何删除错误检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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