如何在opencv中不使用fitEllipse()在图像中检测椭圆? [英] How to detect ellipses in image without using fitEllipse() in opencv?

查看:670
本文介绍了如何在opencv中不使用fitEllipse()在图像中检测椭圆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在OpenCV中使用C ++检测椭圆内核。我已经尝试获取Canny边缘,然后在边缘使用fitEllipse()函数。虽然这找到了椭圆,但是当图像嘈杂,或者有很多边缘时,准确性是可怕的。

I am trying to detect elliptical kernels, in OpenCV using C++. I have tried obtaining Canny edges, and then using fitEllipse() function on the edges. Though this finds ellipses, the accuracy is horrid when the image is noisy, or if there are many edges.

我已经意识到, 省略号,不适合它们。也许像霍夫圆,但椭圆的东西?我也不知道椭圆的长度,因为它在图像之间变化。

I have realised that the way to go is detecting ellipses, and not fitting them. Maybe something like Hough circles, but for ellipses? I also do not know the length the ellipses could be, as it varies between images.

任何人都可以帮助我开始吗?所有相关的答案都很模糊,我只想指向开始的位置。

Can anybody help me get started on that? All related answers are very vague, and I just want pointers on where to start.

推荐答案

如您所知,您不需要椭圆拟合,但椭圆

As you already got, you don't need ellipse fitting, but ellipse detection.

您可以在我的其他答案中找到两篇论文C ++代码可用。我将在此报告完整性:

You can find in my other answer two papers with C++ code available. I'll report here for completeness:



  1. Libuda,I. Grothues,K.-F. Kraiss,Ellipse detection in digital image
    data using geometric features,in:J.Braz,A.Ranchordas,H.Arajo,
    J.Jorge(Eds。),Advances in Computer Graphics and Computer Vision,
    计算机和信息科学通讯第4卷,b。b Springer Berlin Heidelberg,2007,pp。229-239。 链接代码

M。 Fornaciari,A.Prati,R.Cucchiara,
A fast and effective ellipse detector for embedded vision applications,Pattern Recognition,2014 链接代码

M. Fornaciari, A. Prati, R. Cucchiara, "A fast and effective ellipse detector for embedded vision applications", Pattern Recognition, 2014 link, code


也很容易移植到OpenCV 这个matlab脚本与两篇文章的实现:

It's also fairly easy to port to OpenCV this matlab script with the implementation of the two papers:


  • 一种新的高效椭圆检测方法(Yonghong Xie Qiang,Qiang Ji / 2002)

  • with Result Clustering(CA Basca,M Talos,R Brad / 2005)

另一个非常有趣的算法是:

Another very interesting algorithm is:


  • Dilip K. Prasad,Maylor KH Leung and Siu-Yeung Cho,Edge curvature and convexity based ellipse detection method,Pattern Recognition,2012。

Matlab代码可以找到此处

Matlab code can be found here

直接应用霍夫变换对于椭圆是不可行的,因为你将在一个5维的参数空间中工作。这将是真的很慢,不准确。因此,提出了很多算法。在这里提到的:

Directly applying Hough Transform is not feasible for an ellipse, since you'll work in a 5 dimensional parameter space. This will be really slow, and not accurate. So a lot of algorithms have been proposed. Among the ones mentioned here:


  • 谢和吉的方法非常有名,很容易(但仍然很慢)

  • asca et al。方法更快,但可能不准确
  • Prasad et al。方法很快,而且非常准确。

  • Libuda et al。方法非常快速和准确

  • Fornaciari et al。方法是最快的,但在特定情况下可能不准确。

  • Xie and Ji approach is quite famous and very easy (but still slow)
  • Basca et al. approach is faster, but may be not accurate
  • Prasad et al. approach is fast, and very accurate.
  • Libuda et al. approach is very fast and accurate
  • Fornaciari et al. approach is the fastest, but may be inaccurate in particular cases.

对于椭圆检测的最新参考书目,请参阅页面。

For the up-to-date bibliography for ellipse detection, you can refer to this page.

这篇关于如何在opencv中不使用fitEllipse()在图像中检测椭圆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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