Skip to main content

MAGSAC and MAGSAC++

Project description

Important news

I am happy to announce that MAGSAC++ had been included in OpenCV. You can check the documentation at link. A comparison of OpenCV MAGSAC++ with the other robust estimators is at link thanks to Dmytro Mishkin.

OpenCV USAC Benchmark

The MAGSAC and MAGSAC++ algorithms for robust model fitting without using a single inlier-outlier threshold

The MAGSAC and MAGSAC++ algorithms proposed for robust model estimation without a single inlier-outlier threshold.

The MAGSAC paper is available at Link.

The MAGSAC++ available at Link.

Both methods are 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.

Tested on OpenCV 3.46 and 4.3. To run the executable with the examples, copy the "data" folder next to the executable or set the path in the main() function.

If you use the algorithm, please cite

@inproceedings{barath2019magsac,
	author = {Barath, Daniel and Matas, Jiri and Noskova, Jana},
	title = {{MAGSAC}: marginalizing sample consensus},
	booktitle = {Conference on Computer Vision and Pattern Recognition},
	year = {2019},
}

@inproceedings{barath2019magsacplusplus,
	author = {Barath, Daniel and Noskova, Jana and Ivashechkin, Maksym and Matas, Jiri},
	title = {{MAGSAC}++, a fast, reliable and accurate robust estimator},
	booktitle = {Conference on Computer Vision and Pattern Recognition},
	year = {2020},
}

Install from PyPI with pip

There are pre-compiled wheels for Windows and Linux for Python 3.8 - 3.11 that you can install with:

pip install magsac

Thanks to @akaszynski for his contributions.

Installation C++

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

$ git clone https://github.com/danini/magsac --recursive
$ 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.

Next to the executable, copy the data folder and, also, create a results folder.

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.

An example comparing different samplers on fundamental matrix estimation is available at: notebook.

Requirements

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

Performance of MAGSAC++

MAGSAC++ is the state of the art according to "RANSAC in 2020" CVPR tutorial's experiments.

Performance of MAGSAC

MAGSAC is the state of the art according to the recent study Yin et.al."Image Matching across Wide Baselines: From Paper to Practice", 2020.

IMW-benchmark

IMW-Challenge

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymagsac-0.2.1.tar.gz (3.2 MB view hashes)

Uploaded Source

Built Distributions

pymagsac-0.2.1-cp312-cp312-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

pymagsac-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pymagsac-0.2.1-cp311-cp311-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

pymagsac-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pymagsac-0.2.1-cp310-cp310-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pymagsac-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pymagsac-0.2.1-cp39-cp39-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pymagsac-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pymagsac-0.2.1-cp38-cp38-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pymagsac-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page