Skip to content

Commit

Permalink
added info about pip installation
Browse files Browse the repository at this point in the history
  • Loading branch information
ducha-aiki committed Apr 24, 2020
1 parent 577deed commit accaa9f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# pyransac
# pydegensac

This repository contains an Python wrapper of RANSAC for homography and fundamental matrix estimation
from sparse correspondences. It implements [LO-RANSAC](https://link.springer.com/chapter/10.1007/978-3-540-45243-0_31) and [DEGENSAC](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.466.2719&rep=rep1&type=pdf).

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

# Performance

Vanilla pyransac implementation is marginally better than OpenCV one and with degeneracy-check enabled (DEGENSAC) it is the state of the art,
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](https://arxiv.org/abs/2003.01587.pdf)", 2020.

![IMW-benchmark](img/ransacs.png)
Expand All @@ -17,7 +18,13 @@ according to the recent study Yin et.al."[Image Matching across Wide Baselines:

# Installation

To build and install `pyransac`, clone or download this repository and then, from within the repository, run:
To build and install `pydegensac`, you can use pip:

```bash
pip install pydegensac
```

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

```bash
python3 ./setup.py install
Expand All @@ -31,7 +38,7 @@ pip3 install .

# Building hints from Tomasz Malisiewicz

1. Compiling pyransac without a system-wide install.
1. Compiling pydegensac without a system-wide install.

```bash
python3 ./setup.py build
Expand All @@ -45,7 +52,7 @@ CC=gcc-8 python3 ./setup.py build
```

3. 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 pyransac Dockerfile to see the exact packages you need to apt install on an Ubuntu 18.04 system (https://github.com/quantombone/pyransac-dockerfile/blob/master/Dockerfile)
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)

```bash
FROM ubuntu:18.04
Expand All @@ -61,29 +68,29 @@ RUN apt-get install -y cmake libblas-dev liblapack-dev gfortran
RUN apt-get install -y g++ gcc
```

## download and build pyransac
## download and build pydegensac
```
RUN git clone https://github.com/ducha-aiki/pyransac.git
WORKDIR pyransac
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)
```docker
CMD cp -R /pyransac/build/lib.linux-x86_64-3.6/pyransac /target_directory
CMD cp -R /pydegensac/build/lib.linux-x86_64-3.6/pydegensac /target_directory
```

# dockerfile

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


# Example of usage

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

```

Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,22 @@ def copy_test_file(self, src_file):
copyfile(src_file, dest_file)
copymode(src_file, dest_file)

requirements = [ ]
requirements = ["numpy"]
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='pydegensac',
version='0.1.1',
version='0.1.2',
author='Ondra Chum, Dmytro Mishkin',
author_email='ducha.aiki@gmail.com',
license='MIT',
url = 'https://github.com/ducha-aiki/pydegensac', # Provide either the link to your github or to your website
download_url = 'https://github.com/ducha-aiki/pydegensac/archive/v_0.11.tar.gz',
download_url = 'https://github.com/ducha-aiki/pydegensac/archive/v_0.12.tar.gz',
description='Advanced RANSAC (DEGENSAC) with bells and whistles for H and F estimation',
long_description='',
long_description=long_description,
packages=find_packages('src'),
package_dir={'':'src'},
ext_modules=[CMakeExtension('pydegensac/pydegensac')],
Expand Down

0 comments on commit accaa9f

Please sign in to comment.