用于 ANDROID 图像比较的 OpenCV [英] OpenCV for ANDROID image compare

查看:32
本文介绍了用于 ANDROID 图像比较的 OpenCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个应用程序,该应用程序将使用 OpenCv 识别出现在相机前的物体(如纪念碑或其他东西),然后它会显示有关它的信息.

I want to develop app which will recognize object(like monument or something) present in front of camera using OpenCv and then it will show information about it.

所以问题是如何识别对象(如纪念碑或其他东西)的形状或与 OpenCV 的图像进行比较?
最好的方法是什么?

So the question is how to recognize object(like monument or something) shape or compare to images with OpenCV?
And what is the best method for doing this?

如果有对象检测和比较的样本或教程就好了.

It would be good if there was some kind of samples or tutorials for object detection and comparison.

谢谢.

推荐答案

解决问题的最佳方法是使用本地特征检测器,例如 OpenCV 的 SIFT、SURF 和 ORB.

The best method for what you ask is using local features detectors like OpenCV's SIFT, SURF and ORB, for example.

您需要至少一张来自您要检测的对象的图片.之后,这些算法可以将该图像与其他图像进行比较,看看它们是否足够相似.

You need at least one picture from the object you want to detect. Afterwards, those algorithms can compare that image with other images to see if they are similar enough.

这里是算法的文档.

  • ORB 和其他人:

http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html

  • SURF 和 SIFT(非自由"):

http://docs.opencv.org/modules/nonfree/doc/feature_detection.html

这些算法用于该任务的方式是为每张图像选择有趣的点,然后比较它们以查看它们是否匹配.如果找到多个匹配项,则很可能这些图像具有相同的对象.

The way these algorithms work for that task is by selecting interesting points for each image, and compare them to see if they match. If several matches are found, it is most likely the images have the same object.

教程(来自特征检测及以下):

Tutorials (from Feature Detection and below):

http://docs.opencv.org/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.html

您还可以在此处找到与此主题相关的 C++ 示例(示例也在 OpenCV 下载包中):

You can also find C++ samples related to this topic here (samples are also within OpenCV download package):

  • 例如."matching_to_many_images.cpp"
  • video_homography.cpp"

http://code.opencv.org/projects/opencv/repository/revisions/master/show/samples/cpp

还有 Android Java 示例(不相关但也很有帮助):

And Android Java samples here (unrelated but also helpful):

http://code.opencv.org/projects/opencv/repository/revisions/master/show/samples/android

Python 示例,它们实际上是该主题的更新版本(在撰写本文时):

Or Python samples which are actually the more updated ones for this topic (at the time this post was written):

http://code.opencv.org/projects/opencv/repository/revisions/master/show/samples/python2

作为最后一点,就像@BDFun 在评论中所说,这并非易事.

As a final note, like @BDFun said in the comment, this is not trivial to do.

更多 - 如果您想了解 OpenCV 特征检测和描述的概述,查看这篇文章.

More - if you want an overview of OpenCV Feature detection and description, check this post.

这篇关于用于 ANDROID 图像比较的 OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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