椭圆检测与OpenCV的 [英] Ellipse detection with OpenCV

查看:1301
本文介绍了椭圆检测与OpenCV的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检测椭圆与OpenCV的Andr​​oid版,使用教程2,基本包含OpenCV的2.4.1包作为一个出发点。请注意,我的椭圆将是一个完美-的Photoshop之一。

I would like to detect ellipses with OpenCV for Android, using the Tutorial 2-Basic included with OpenCV 2.4.1 package as a starting point. Note that my ellipse would be a perfect-photoshop one.

据我了解,使用HoughCircles只能找到完美(左右)的圈子,从而留下椭圆出来。

From what I understand, using the "HoughCircles" will only find perfect (or so) circles, thus leaving ellipses out.

任何帮助将是非常美联社preciated因为我在OpenCV的总的初学者

Any help would be much appreciated as I am a total beginner at OpenCV

这是我试过到目前为止

    case Sample2NativeCamera.VIEW_MODE_CANNY: (ignore the Canny mode...)

        capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
        Imgproc.HoughCircles(mGray, mCircles, Imgproc.CV_HOUGH_GRADIENT, 1, 20);
        Log.d("Ellipse Points", " X " + mCircles.get(1,1)[0] + mCircles.get(1, 1)[1]);

        break;

如果您认为任何更多的信息可能是有用的,请让我知道。

If you think any more info could be useful, please let me know.

谢谢!

推荐答案

一种可能的解决问题的方法与此类似线程的检测硬币(气盛椭圆)上的图像

One possible solution to your problem is similar to this thread Detection of coins (and fit ellipses) on an image .

您应该看看一个OpenCV的函数<一href="http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=fitellipse#fitellipse">fitEllipse.

You should take a look a opencv's function fitEllipse.

这篇关于椭圆检测与OpenCV的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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