• Stars
    star
    429
  • Rank 101,271 (Top 2 %)
  • Language
    C++
  • License
    Other
  • Created about 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Graph-Cut RANSAC algorithm proposed in paper: Daniel Barath and Jiri Matas; Graph-Cut RANSAC, Conference on Computer Vision and Pattern Recognition, 2018. It is available at http://openaccess.thecvf.com/content_cvpr_2018/papers/Barath_Graph-Cut_RANSAC_CVPR_2018_paper.pdf

Important news

I am happy to announce that Graph-Cut RANSAC had been included in OpenCV. You can check the documentation at link.

Graph-Cut RANSAC

The Graph-Cut RANSAC algorithm proposed in paper: Daniel Barath and Jiri Matas; Graph-Cut RANSAC, Conference on Computer Vision and Pattern Recognition, 2018. It is available at http://openaccess.thecvf.com/content_cvpr_2018/papers/Barath_Graph-Cut_RANSAC_CVPR_2018_paper.pdf

The journal paper with updated spatial coherence term and additional experiments is available at https://ieeexplore.ieee.org/document/9399280

The method is explained in the Latest developments in RANSAC presentation from CVPR tutorial RANSAC in 2020.

Experiments on homography, fundamental matrix, essential matrix, and 6D pose estimation are shown in the corresponding presentation from the tutorial RANSAC in 2020.

Installation C++

To build and install C++ only GraphCutRANSAC, clone or download this repository and then build the project by CMAKE.

$ git clone https://github.com/danini/graph-cut-ransac
$ cd build
$ cmake ..
$ make

Install Python package and compile C++

python3 ./setup.py install

or

pip3 install -e .

Example project

To build the sample project showing examples of fundamental matrix, homography and essential matrix fitting, set variable CREATE_SAMPLE_PROJECT = ON when creating the project in CMAKE. Then

$ cd build
$ ./SampleProject

Requirements

  • Eigen 3.0 or higher
  • CMake 2.8.12 or higher
  • OpenCV 3.0 or higher
  • A modern compiler with C++17 support

Example of usage in python

import pygcransac
h1, w1 = img1.shape
h2, w2 = img2.shape
H, mask = pygcransac.findHomography(src_pts, dst_pts, h1, w1, h2, w2, 3.0)
F, mask = pygcransac.findFundamentalMatrix(src_pts, dst_pts, h1, w1, h2, w2, 3.0)

Jupyter Notebook example

The example for homography fitting is available at: notebook.

The example for fundamental matrix fitting is available at: notebook.

The example for essential matrix fitting is available at: notebook.

The example for essential matrix fitting with planar motion assumption is available at: notebook.

The example for essential matrix fitting with known gravity is available at: notebook.

The example for essential matrix fitting is available at: notebook.

The example for 6D pose fitting is available at: notebook.

An example comparing different samplers on fundamental matrix fitting: notebook.

Jupyter Notebook example (Affine and SIFT correspondence-based solvers)

The example for homography fitting to SIFT correspondences is available at: notebook.

The example for essential matrix fitting to SIFT correspondences is available at: notebook.

The example for fundamental matrix fitting to SIFT correspondences is available at: notebook.

The example for homography fitting to affine correspondences is available at: notebook.

The example for essential matrix fitting to affine correspondences is available at: notebook.

The example for fundamental matrix fitting to affine correspondences is available at: notebook.

Requirements

  • Python 3
  • CMake 2.8.12 or higher
  • OpenCV 3.4
  • A modern compiler with C++11 support

Acknowledgements

When using the algorithm, please cite

@inproceedings{GCRansac2018,
	author = {Barath, Daniel and Matas, Jiri},
	title = {Graph-cut {RANSAC}},
	booktitle = {Conference on Computer Vision and Pattern Recognition},
	year = {2018},
}

If you use it together with Progressive NAPSAC sampling or DEGENSAC, please cite

@inproceedings{PNAPSAC2020,
	author = {Barath, Daniel and Noskova, Jana and Ivashechkin, Maksym and Matas, Jiri},
	title = {{MAGSAC}++, a Fast, Reliable and Accurate Robust Estimator},
	booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
	month = {June},
	year = {2020}
}

@inproceedings{Degensac2005,
	author = {Chum, Ondrej and Werner, Tomas and Matas, Jiri},
	title = {Two-View Geometry Estimation Unaffected by a Dominant Plane},
	booktitle = {Conference on Computer Vision and Pattern Recognition},
	year = {2005},
}

If you use with Space Partitioning turned on, please cite

@inproceedings{spaceransac2021,
	author = {Barath, Daniel and Valasek, Gabor},
	title = {Space-Partitioning {RANSAC}},
	journal={arXiv preprint arXiv:2111.12385},
	year = {2021}
}

The Python wrapper part is based on the great Benjamin Jack python_cpp_example.

More Repositories

1

magsac

The MAGSAC algorithm for robust model fitting without using an inlier-outlier threshold
C++
425
star
2

progressive-x

The Progressive-X algorithm proposed in paper: Daniel Barath and Jiri Matas; Progressive-X: Efficient, Anytime, Multi-Model Fitting Algorithm, International Conference on Computer Vision, 2019. It is available at https://arxiv.org/pdf/1906.02290
Jupyter Notebook
70
star
3

homography-benchmark

Python
65
star
4

pose-graph-initialization

C++
43
star
5

affine-correspondences-for-camera-geometry

C
43
star
6

multi-h

The C++ implementation of Multi-H algorithm, which is a multi-plane fitting technique. If you use this work for Academic purposes, please cite Barath, D. and Matas, J. and Hajder, L., Multi-H: Efficient Recovery of Tangent Planes in Stereo Images. 27th British Machine Vision Conference, 2016
C++
32
star
7

homography-from-sift-features

MATLAB
27
star
8

multi-x

The Multi-X algorithm proposed in paper: Daniel Barath and Jiri Matas, Multi-class model fitting by energy-minimization and mode-seeking, European Conference on Computer Vision, 2018. It is available at http://openaccess.thecvf.com/content_ECCV_2018/papers/Daniel_Barath_Multi-Class_Model_Fitting_ECCV_2018_paper.pdf
C++
15
star
9

five-point-fundamental

The Matlab implementation of the 5 point fundamental matrix estimator. If you use this work for Academic purposes, please cite Barath, D., Five-point fundamental matrix estimation for uncalibrated cameras, Conference on Computer Vision and Pattern Recognition, 2018
MATLAB
14
star
10

absolute-pose-from-oriented-and-scaled-features

C++
13
star
11

clustering-in-consensus-space

Jupyter Notebook
11
star
12

cvpr2022-affine-tutorial

The official site of the CVPR 2022 Affine Correspondences and Their Applications tutorial
SCSS
11
star
13

learning-good-models-in-ransac

10
star
14

recovering-affine-features

D. Barath, "Recovering affine features from orientation-and scale-invariant ones", Asian Conference on Computer Vision (ACCV), 2019
MATLAB
5
star
15

robust-line-based-estimator

Jupyter Notebook
3
star
16

sutd_hololens_mapping

Python
2
star