/opencv

Learn OpenCV, ORB/SIFT descriptors match by ratio test to find similarity.

Primary LanguageC++

Learning OpenCV !!


1. Feature Detecting Methods Compare

=> feature_methods_compare.cxx : Compare the speed of feature detecting method(just detecting, it is easy to include the descriptors computing into it.)

Test Results

2.To See How Ratio impact the ORB Descriptors Matching.

=> ORB_match0.cpp : detect features, compute descriptors, then broute force match them ,but the result is bad, even not similar images also mathces too many!

=> ORB_match.cpp : After the ratio test and symmetric test, the result is good, but with ORB the Jaccard similarity is low.(Q)

ratio image1 keypoints size image2 keypoints size Good matches1 Good matches2 Better matches
0.9 500 487 287 263 176
0.85 500 487 237 218 157
0.8 500 487 209 192 144
0.75 500 487 170 160 120
0.65 500 487 113 106 76

So, You can see the trend!

3.Combine Them Together to Implement Image Retrieval by similarity.

=> image-search

=> Test Results

  1. 500 features with ratio 0.9

  2. 1000 features with ratio 0.8

4. How the Query Image size impact the retrieval score.

test result

5. Dump the Descriptors to file for using next time, make it faster to process large dataset. There are two mehtods:1)You can define your own serialization format, such as my demo, 2) Using OpenCV built in component FileStorage. Here I Choose the second method for its easy use.

==> write ORB descriptors to file batchly ==> write SIFT descriptors to file batchly

6.1 This time I get train images' ORB descriptors from file to do the image retrieval!

test result

查询图片也从orb特征向量文件中获取 2015.8.23

**问题:**从图片得到的descriptos.cols可能为0,所以在匹配的时候就会出现类型不匹配的错误!

6.2 As above, get train images' SIFT descriptors from files, and then do image retrieval.

Source Code

使用SIFT特征向量进行相似图片查找 Source

7. Match descriptors of SIFT,ORB,FAST,etc ,and show how two images matched...

==>match

8.Image resize by scale factor and dump them to specified folders.

==>resize

8.Other easy demo on the road.

==>demo

9. My Blog is Here vonzhou.