Ellipse detection with OpenCV(使用 OpenCV 进行椭圆检测)
问题描述
我想使用 OpenCV for Android 检测椭圆,使用 OpenCV 2.4.1 包中包含的 Tutorial 2-Basic 作为起点.请注意,我的椭圆将是一个完美的 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.
任何帮助将不胜感激,因为我是 OpenCV 的初学者
Any help would be much appreciated as I am a total beginner at OpenCV
这是我迄今为止尝试过的
This is what I've tried so far
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.
推荐答案
您的问题的一个可能解决方案类似于此线程 Detection of图片上的硬币(和适合的椭圆) .
One possible solution to your problem is similar to this thread Detection of coins (and fit ellipses) on an image .
你应该看看opencv的函数fitEllipse.
You should take a look a opencv's function fitEllipse.
这篇关于使用 OpenCV 进行椭圆检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 OpenCV 进行椭圆检测


基础教程推荐
- 如何使用 Java 创建 X509 证书? 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01