检测图像中圆圈的快速方法有哪些? [英] What are the possible fast ways to detect circle in an image?

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

问题描述

有什么方法可以快速检测图像中的圆圈?

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

例如:
i有一个带有一个Big Circle的图像,有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(评论中提到的jamk)和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。)

  • 预处理边缘点图像以消除异常值。消除异常值的适当算法将特定于您的图像集,但您可能能够找到一种消除明显异常值的算法,从而在更昂贵的圆拟合算法中节省一些搜索时间。

  • 如果您的圆圈定义得很好,且所有或几乎所有点都存在,请弄清楚如何只匹配四分之一圆或半圆而不是整圆。

  • Carefully set the range or ranges over which radii are checked. For example, you might not simply check from the smallest possible radius to the largest possible radius, but instead you might split the search into two different ranges: from radius R1 to R2, and then from radius R3 to R4.
  • Ditch the Canny edge detection in favor of the fastest possible edge detection your application can tolerate. (You can ditch Canny for lots of applications.)
  • Preprocess your image of edge points to eliminate outliers. The appropriate algorithm to eliminate outliers will be specific to your image set, but you'll probably be able to find an algorithm that eliminates obvious outliers and thereby saves some search time in the more expensive circle fit algorithms.
  • If your circles are very well defined, and all or nearly all points are present, figure out how you might match only a quarter circle or semicircle instead of a full circle.

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

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. 通过图像中的所有比例重复上述步骤。

  1. Find circles at the very smallest scale. The image will be small and the range of possible radii will be limited, so this should be a quick operation.
  2. If you find a circle using the initial fit at the small scale, improve the fit by testing in the next larger scale image -OR- go ahead and search in the full scale image.
  3. Check the next largest scale. Circles that weren't visible in the smaller scale image may suddenly "appear" in the current scale.
  4. Repeat the steps above through all scales in the image.

图像缩放将是一个快速操作,您可以看到,如果您的圆圈中至少有一个圆圈出现在较小比例的图像中,您应该能够减少通过在小比例图像中执行粗圆拟合然后在全比例图像中优化这些边缘点的拟合来完成总周期数。

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天全站免登陆