Skip to main content

Advanced RANSAC (DEGENSAC) with bells and whistles for H and F estimation

Project description

pydegensac

This repository contains an Python wrapper of RANSAC for homography and fundamental matrix estimation from sparse correspondences. It implements LO-RANSAC and DEGENSAC.

It was originally located in https://github.com/ducha-aiki/pyransac, but was renamed to avoid conflict with already existing pyransac in pypi from other author.

Performance

Vanilla pydegensac implementation is marginally better than OpenCV one and with degeneracy-check enabled (DEGENSAC) it 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

Installation

To build and install pydegensac, you can use pip:

pip install pydegensac

Or clone or download this repository and then, from within the repository, run:

python3 ./setup.py install

or

pip3 install .

Building hints from Tomasz Malisiewicz

  1. Compiling pydegensac without a system-wide install.
python3 ./setup.py build
  1. Compiling on Mac OS X computer Use GCC instead of Clang. The most recent version on my machine (installed via brew) is gcc-8. Try this:
CC=gcc-8 python3 ./setup.py build
  1. Compiling on Ubuntu 18.04 You need LAPACK and a few other libraries and I always forget those specific package names. Take a look at my pydegensac Dockerfile to see the exact packages you need to apt install on an Ubuntu 18.04 system (https://github.com/quantombone/pydegensac-dockerfile/blob/master/Dockerfile)
FROM ubuntu:18.04

update system

RUN apt-get clean
RUN apt-get update
RUN apt-get install -qy \
    git python3 python3-setuptools python3-dev
RUN apt-get install -y cmake libblas-dev liblapack-dev gfortran
RUN apt-get install -y g++ gcc

download and build pydegensac

RUN git clone https://github.com/ducha-aiki/pydegensac.git
WORKDIR pydegensac
RUN python3 ./setup.py build

copy built assets into target directory (which will be a -v volume)

CMD cp -R /pydegensac/build/lib.linux-x86_64-3.6/pydegensac /target_directory

dockerfile

https://github.com/quantombone/pydegensac-dockerfile

Example of usage

import pydegensac
H, mask = pydegensac.findHomography(src_pts, dst_pts, 3.0)
F, mask = pydegensac.findFundamentalMatrix(src_pts, dst_pts, 3.0)

See also this notebook with simple example

And this notebook with detailed explanation of possible options

Requirements

  • Python 3
  • CMake 2.8.12 or higher
  • LAPACK,
  • BLAS (OpenBLAS, MKL, Atlas, ...)
  • A modern compiler with C++11 support

Citation

Please cite us if you use this code:

@InProceedings{Chum2003,
author="Chum, Ond{\v{r}}ej and Matas, Ji{\v{r}}{\'i} and Kittler, Josef",
title="Locally Optimized RANSAC",
booktitle="Pattern Recognition",
year="2003",
}

@inproceedings{Chum2005,
author = {Chum, Ondrej and Werner, Tomas and Matas, Jiri},
title = {Two-View Geometry Estimation Unaffected by a Dominant Plane},
booktitle = {CVPR},
year = {2005},
}

@article{Mishkin2015MODS,
      title = "MODS: Fast and robust method for two-view matching ",
      journal = "Computer Vision and Image Understanding ",
      year = "2015",
      issn = "1077-3142",
      doi = "http://dx.doi.org/10.1016/j.cviu.2015.08.005",
      url = "http://www.sciencedirect.com/science/article/pii/S1077314215001800",
      author = "Dmytro Mishkin and Jiri Matas and Michal Perdoch"
}

Acknowledgements

This wrapper part is based on great Benjamin Jack python_cpp_example.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pydegensac-0.1.3-cp39-cp39-win32.whl (7.0 MB view hashes)

Uploaded CPython 3.9 Windows x86

pydegensac-0.1.3-cp38-cp38-win32.whl (7.0 MB view hashes)

Uploaded CPython 3.8 Windows x86

pydegensac-0.1.3-cp37-cp37m-win32.whl (7.0 MB view hashes)

Uploaded CPython 3.7m Windows x86

pydegensac-0.1.3-cp36-cp36m-win32.whl (7.0 MB view hashes)

Uploaded CPython 3.6m Windows x86

pydegensac-0.1.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (104.4 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pydegensac-0.1.2-cp311-cp311-manylinux_2_28_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

pydegensac-0.1.2-cp311-cp311-macosx_13_0_arm64.whl (110.3 kB view hashes)

Uploaded CPython 3.11 macOS 13.0+ ARM64

pydegensac-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pydegensac-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pydegensac-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (89.6 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pydegensac-0.1.2-cp39-cp39-win_amd64.whl (417.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pydegensac-0.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pydegensac-0.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pydegensac-0.1.2-cp39-cp39-macosx_11_0_arm64.whl (89.5 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pydegensac-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (104.9 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pydegensac-0.1.2-cp38-cp38-win_amd64.whl (417.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pydegensac-0.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pydegensac-0.1.2-cp38-cp38-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.8

pydegensac-0.1.2-cp38-cp38-macosx_11_0_arm64.whl (89.2 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pydegensac-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (104.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pydegensac-0.1.2-cp37-cp37m-win_amd64.whl (414.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pydegensac-0.1.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pydegensac-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.7m

pydegensac-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (104.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pydegensac-0.1.2-cp36-cp36m-win_amd64.whl (414.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pydegensac-0.1.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

pydegensac-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.6m

pydegensac-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl (104.5 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pydegensac-0.1.2-cp35-cp35m-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.5m

pydegensac-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 2.7mu

pydegensac-0.1.2-cp27-cp27m-manylinux1_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 2.7m

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