检测图像中圆圈的可能快速方法是什么? [英] What are the possible fast ways to detect circle in an image?

查看:14
本文介绍了检测图像中圆圈的可能快速方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检测图像中圆圈的快速方法有哪些?

What are the possible fast ways to detect circle in an image ?

例如:我有一个大圆圈的图像,大圆圈内有 6 个小圆圈.

For ex: i have an image with one Big Circle and has 6 small circles inside big Circle.

我需要在不使用 Hough Circles(OpencV) 的情况下找到一个大圆圈.

I need to find a big circle without using Hough Circles(OpencV).

推荐答案

寻找圆的标准算法是 Hough(评论中提到的)和 RANSAC.参数化这些算法将为您的应用程序设置基线速度.

Standard algorithms to find circles are Hough (which jamk mentioned in the comments) and RANSAC. Parameterizing these algorithms will set a baseline speed for your application.

http://en.wikipedia.org/wiki/Hough_transform

http://en.wikipedia.org/wiki/RANSAC

要加快这些算法的速度,您可以查看您的图像集合并决定限制搜索范围是否有助于加快搜索速度.这很简单:只在合理范围内搜索半径.由于它们将边缘点作为输入,因此您还可以查看减少检查的边缘点数量的方法.

To speed up these algorithms, you can look at your collection of images and decide whether limiting the search ranges will help speed up the search. That's straightforward enough: only search within a reasonable range for the radius. Since they take edge points as inputs, you can also look at methods to reduce the number of edge points checked.

不过,还有一些其他技巧可以加快处理速度.

However, there are a few other tricks to speed up processing.

  • 仔细设置检查半径的范围.例如,您可能不会简单地从可能的最小半径到可能的最大半径进行检查,而是可能会将搜索分成两个不同的范围:从半径 R1 到 R2,然后从半径 R3 到 R4.
  • 放弃 Canny 边缘检测,转而采用您的应用程序可以容忍的最快边缘检测.(你可以放弃 Canny 来获得很多应用程序.)
  • 对边缘点图像进行预处理以消除异常值.消除异常值的适当算法将特定于您的图像集,但您可能会找到一种消除明显异常值的算法,从而在更昂贵的圆拟合算法中节省一些搜索时间.
  • 如果您的圆圈定义非常明确,并且所有或几乎所有点都存在,请弄清楚您如何仅匹配四分之一圆或半圆而不是整圆.

长话短说:从一个完整的实现开始并对其进行基准测试,然后逐渐收紧参数设置并限制搜索范围,同时确保您仍然可以找到适合您的应用程序和图像集的圆圈.

Long story short: start with a complete implementation and benchmark it, then gradually tighten up parameter settings and limit search ranges while ensuring that you can still find circles for your application and your image set.

如果您的图像适合缩放,那么一种可能性是创建不同比例的图像金字塔:1/2 比例、1/4 比例、1/8 比例等.您需要一个边缘 -在较小的尺度上保留缩放方法.

If your images are amenable to scaling, then one possibility is to create an image pyramid of images at different scales: 1/2 scale, 1/4 scale, 1/8 scale, etc. You'll need an edge-preserving scaling method at smaller scales.

建立图像金字塔后,请尝试以下操作:

Once you have your image pyramid, try the following:

  1. 找到最小比例的圆圈.图像会很小而且可能的半径范围是有限的,所以这应该是快速操作.
  2. 如果您在小比例尺上使用初始拟合找到了一个圆,请通过在下一张较大比例的图像中进行测试来改进拟合 - 或者 - 继续在全比例图像中进行搜索.
  3. 检查下一个最大的比例.在较小比例图像中不可见的圆圈可能会突然出现"在当前比例中.
  4. 对图片中的所有比例重复上述步骤.

图像缩放将是一种快速操作,您可以看到,如果您的至少一个圆圈出现在较小比例的图像中,您应该能够通过在小范围内执行粗略的圆圈拟合来减少循环总数缩放图像,然后在全尺寸图像中单独优化这些边缘点的拟合.

Image scaling will be a fast operation, and you can see that if at least one of your circles is present in a smaller scale image you should be able to reduce the total number of cycles by performing a rough circle fit in the small scale image and then optimizing the fit for those edge points alone in the full scale image.

边缘保留缩放还可以使用相关类型的工具来查找圆,但能否做到这一点取决于图像的内容,包括噪声、边缘点表示圆的完整程度等等.

Edge-preserving scaling can also make it possible to use correlation-type tools to find circles, but being able to do so depends on the content of your images, including the noise, how completely edge points represent circles, and so on.

这篇关于检测图像中圆圈的可能快速方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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