Giter VIP home page Giter VIP logo

gms-feature-matcher's Introduction

GMS: Grid-based Motion Statistics for Fast, Ultra-robust Feature Correspondence

alt tag

Publication:

JiaWang Bian, Wen-Yan Lin, Yasuyuki Matsushita, Sai-Kit Yeung, Tan Dat Nguyen, Ming-Ming Cheng, GMS: Grid-based Motion Statistics for Fast, Ultra-robust Feature Correspondence, CVPR 2017, [Project Page] [pdf] [Bib] [Code] [Youtube]

JiaWang Bian, Wen-Yan Lin, Yun Liu, Le Zhang, Sai-Kit Yeung, Ming-Ming Cheng, Ian Reid, GMS: Grid-based Motion Statistics for Fast, Ultra-robust Feature Correspondence, IJCV 2020, [pdf]

Other Resouces

The method has been integrated into OpenCV library (see xfeatures2d.matchGMS).

More experiments are shown in FM-Bench.

The paper was selected and reviewed by Computer Vision News.

If you find this work useful in your research, please consider citing our paper:

@article{Bian2020gms,
	title={{GMS}: Grid-based Motion Statistics for Fast, Ultra-Robust Feature Correspondence},
	author={Bian, JiaWang and Lin, Wen-Yan and Liu, Yun and Zhang, Le and Yeung, Sai-Kit and Cheng, Ming-Ming and Reid, Ian},
	journal={International Journal of Computer Vision (IJCV)},
	year={2020}
}

Usage

Requirement:

1.OpenCV 3.0 or later (for ORB features, necessary)

2.cudafeatures2d module(for gpu nearest neighbor, optional)

3.OpenCV xfeatures2D moudle (if using the opencv built-in GMS function) 

C++ Example:

See src/demo.cpp

Python Example:

Go to "python" folder. Run "python3 opencv_demo.py". 
(You need install opencv_contrib by "pip install opencv-contrib-python")

Matlab Example:

1. Go to "matlab" folder. Compile the code with OpenCV ('Compile.m'), and run 'demo.m'.

External Examples:

OpenCV C++ demo and Mexopencv example

Tuning Parameters:

In src/demo.cpp
	1.	#define USE_GPU" (need cudafeatures2d module) 
			using cpu mode by commenting it.
			
	2.	We suggest using SIFT features for accuracy, and using ORB features for speed.


In gms_matcher.h
			
	2.	#define THRESH_FACTOR 6		
			Set it higher for more input matches, and lower for the fewer input matches.
			Often 6 for ORB all matches, and 4 or 3 for SIFT matches (after ratio test).
			
	3. 	int GetInlierMask(vector<bool> &vbInliers, bool WithScale = false, bool WithRotation = false)
			Set WithScale to be true for wide-baseline matching and false for video matching.
			Set WithRotation to be true if images have significant reative rotations.

Related projects

  • FM-Bench (BMVC 2019, More evaluation details for GMS.)

gms-feature-matcher's People

Contributors

jiawangbian avatar kczarnota avatar mpkuse avatar suruoxi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gms-feature-matcher's Issues

GMS在PC机耗时多长?

matches = cv.xfeatures2d.matchGMS(img1.shape, img2.shape, kp1, kp2, matches_all, withRotation=True, withScale=True,thresholdFactor=threshold),这个算子耗时53ms,比单应性耗时还长,是什么回事呢?

关于特征点分散和GMS兼容的问题

大神你好,我本来打算将你的算法应用在ORB-SLAM里面,但是ORB-SLAM的特征提取方法基于四叉树做了均匀处理,分散得比较开,这样的话GMS匹配貌似没有优势了。反而用opencv自带的ORB算法,由于opencv的特征点扎堆,GMS更能够筛选出正确的配对。
在SLAM中,我们更希望特征点分散来精准估计位姿,这种期望貌似和GMS的栅格统计原理是不兼容的,请问大神有解决思路吗???

ORB-GMS方案只能用BruteForce匹配吗?

如题,ORB和BRIEF特征描述子是uchar型。所以是不是只能用BruteForce匹配,之前看您主页下面的介绍里说到了NN匹配,请问这是什么情况呢,不太了解烦请解答,十分感谢

关于准确率和召回率的问题

边老师,我最近也在研究特征匹配,很想知道怎么确定匹配点是否正确匹配,在网上搜索,有的人说某些开源数据集提供单应矩阵,通过单应矩阵的转换,判断是否匹配正确,但是我目前还没有找到,不知道您可不可以提供一些带有单应矩阵的数据集。

全景照片 特殊处理?

您好,大神,谢谢您分享了您的代码,效果非常好。
我想问下,您之前用过GMS对全景照片(spherical)做过处理吗?
如果做的话,您有什么好的意见和方法吗?

SIFT or SURF

the code used ORB, But I want o use SIFT or SURF , and the matchs is zero ? need more changed?

Improve running time

Hi, thanks for this contribution. I'm trying to use gms matcher in my project but it takes too long to finish every task. Do you have any recommendations to speed up the process?

matlab compile

你好, matlab2016b, 使用 'Microsoft Visual C++ 2013 Professional' 编译。
opencv: 320 版本;
编译报错:
错误使用 mex
正在创建库 MexGMS.lib 和对象 MexGMS.exp
MexGMS.obj : error LNK2019: 无法解析的外部符号void __cdecl cv::fastFree(void *)"
(?fastFree@cv@@YAXPEAX@Z),该符号在函数 "public: cdecl gms_matcher::gms_matcher(class
std::vector<class cv::KeyPoint,class std::allocator > const &,class
cv::Size
,class std::vector<class cv::KeyPoint,class std::allocator >
const &,class cv::Size
,class std::vector<class cv::DMatch,class std::allocator<class
中被引用 " ... ... 有25个无法解析的外部符号;
这个问题怎么解决?

opencv 320中 以后只有一个lib了: opencv_world320.lib 所以只包含了这个。
谢谢

Segmentation fault with demo.cpp and withScale=false, withRotation=true

In demo.cpp, change
num_inliers = gms.GetInlierMask(vbInliers, false, false);
by
num_inliers = gms.GetInlierMask(vbInliers, false, true);
The segmentation fault seems to occur here:

#0 gms_matcher::AssignMatchPairs (this=this@entry=0x7fffffffd390, GridType=GridType@entry=1) at src/GMS-Feature-Matcher/include/gms_matcher.h:326

matlab demo error

Compile.m编译好之后,当前文件夹已经存在MexGMS.mexw64,依然报错:
Invalid MEX-file 'D:\Github\GMS-Feature-Matcher-master\matlab\MexGMS.mexw64': 找不到指定的模块。

请问是什么原因呢?

matlab Compile error

谢谢您的分享,非常棒的工作。
想请教您两个问题

  1. 我双击opencv.exe安装后,在产生的文件夹里没有找到 opencv_core320.lib, libopencv_core320.lib这两个文件,所以会有报错,请问该如何解决呢?
    麻烦您了,谢谢
Error using mex
MEX cannot find library 'opencv_core320' specified with the -l option.
 MEX looks for a file with one of the names:
 opencv_core320.lib
 libopencv_core320.lib
 Please specify the path to this library with the -L option.
  1. 下面两行代码前面加-l和-L是什么意思呢?
IPath = ['-I' OpenCV 'include'];
LPath = ['-L' OpenCV 'x64/vc14/lib'];

matlab demo.m error

您好,非常感谢您的工作,在编译完MexGMS.cpp之后(vs2015 C++ complier), 运行demo.m出现如下报错:
image

个人运行环境为:
visual studio 2015 professional
Matlab2015b

请问该如何解决呢?

How did you get R and t from matches?

Hello,

I am trying to reproduce your results for the strecha dataset, and was wondering if the benchmark code is available. Since their are hundreds of ways to get the R and the t from the matches, can you please let me know how you retrieved the pose? or the fundamental matrix?

Cheers,
Kwang

找不到源码

类似detectAndCompute等函数的代码为啥找不到。但是编译可以通过。mex.h也找不到。

GMS-matcher in ORB-Slam

hi
can i replace gms-matcher with the matcher used in ORB-Slam?can someone explain what is the difference between these matchers?

No Real-time performance

Hello~ On my machine, the real-time performance seems doesn't presented,what could be the reasons?
Details of my computer
OS: Ubuntu 14.04 LTS
CPU: Intel® Core™ i7-6700K CPU @ 4.00GHz × 8
GPU: GeForce GTX 1080/PCIe/SSE2
OpenCV Version: 3.2.0
Cmake Verion: 3.4.1

Experiment settings:
Input image: 480x720,
Average time( time for drawing time is excluded):
CPU : 1.39s
GPU :0.21s

Thanks~

opencv-contrib-python version

Hi,

I am trying to use your GMS feature matcher in python. But, in your python example code, you import matchGMS by "from cv2.xfeatures2d import matchGMS". Could you please make it clear about what opencv-contrib-python version did you use that included this package? Also, could you please tell us the python version that you used for this?
I am currently testing on two versions and none of them worked:
(1) python3.6 with opencv-contrib-python 3.4.0.12 (from cv2.xfeatures2d import matchGMS ImportError: cannot import name 'matchGMS')
(2) python3.7 with opencv-contrib-python 4.4.0.46 (cv2.xfeatures2d). Note that opencv4.5 has matchGMS feature but opencv-contrib-python only has 4.4

Thanks!

[QUESTION] Comparing to thousands of images

I have a question, it is not well related to the algorithm itself, but how to best way use it in a specific scenario.

the algorithm worked very well when comparing 2 images, images that represent the same scenario regardless of angle, rotation, color, size ... the match was found successfully.

I am using the algorithm to detect duplicate images.

example 2 different images, one photo taken from the side and the other from the front of anyone object, both are different photos, but represent the same object in different positions

the question is: how to use the algorithm to compare an image against a database with thousands of other images to find a duplicate?

and if that image is not found in the database, it will be added as a new image, in this case I think I could not use BoW, because I would have to train it again with each image added to the database, right?

Can this method be used to improve accuracy?

Hello, thanks for your great work. Here I tried your method in my work, and I found that your method was more likely to be used to improve ORB features matching, while it didn't improve performance for AKAZE features matching. I have also read your paper, and here is my question.
This method can improve ORB features matching because it can produce a lot of features and those features sometimes cannot match well.So here the law of large numbers works. But for AKAZE matching, since it can match accurately at first, the law of large numbers cannot improve it any more. Am I right about this method?
I'll appreciate it if you can give me a reply.

with_rotation and with_scale are setted error

Lines 173 lines and 185 lines in gms_matcher.py(python version),the conditions are the opposite of what is handled. The conditions or handling of lines 173 lines and 185 lines should be exchanged.

using with AKAZE?

Hi, and thanks for making this code available. I am running it with ORB features, and it works great, but I would like to test with AKAZE. When I switch though, I get hardly any matches. What can I change to use this code with AKAZE features?

Thanks!

关于不同尺度图片的匹配问题

请问,将一张图片中目标区域裁剪出patch作为图片,这个patch是否可以和原图进行匹配,两个图片大小不一致能否进行匹配呢?
还有一个小问题:匹配完成后的匹配点对中,要怎样可以判断匹配的置信度最高的那个点对呢?或者说那几个点?

编译通过运行错误

运行至orb->detectAndCompute(img1, Mat(), kp1, d1);时,会产生异常,进而触发一个断点。。。我用的是opencv3,不知道为什么这个自带函数会出现错误,还望指教,之前在作者的主页下面看见过同样的问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.