OpenCV for ANDROID image compare

人盡茶涼 提交于 2019-11-28 19:54:18
Rui Marques

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.

Here is the Documentation for the algorithms.

  • ORB and others:

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

  • SURF and SIFT ('nonfree'):

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

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

  • eg. "matching_to_many_images.cpp"
  • "video_homography.cpp"

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

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

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

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!