ducha-aiki /pydegensac

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

★ 300⑂ 36👁 7⑃ 40● 17▤ 7
C++NOASSERTIONCreated 2020-04-24
下载:Speed optimizations.v_0.3.1 ↓0.3.12026-11-11
+0
日增长
300
stars
36
forks
7
watchers
40
prs
17
issues
7
releases

README

pydegensac

This repository contains a 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 on PyPI from another author.

 Speed across releases

Fundamental-matrix mAA against time per image pair for 0.1.2, 0.2.2, 0.3.0
and 0.3.1, all installed from PyPI into one environment (Python 3.11,
numpy 1.26). Lines are the mean over 10 seeds; bands show the min–max across
seeds. At 50k iterations 0.3.1 takes 31 ms per pair where 0.2.2 took 144 ms
(4.7x), and no release differs in accuracy by more than seed-to-seed noise.

!F time-mAA across releases

 Release history

- 0.1.1 / 0.1.2 (April 2020) — the original C code by Ondřej Chum, with
  small changes for the LAF consistency check, wrapped with pybind11. 0.1.2
  added prebuilt wheels. Yanked: with numpy 2.x it returns every correspondence
  as an inlier.
- 0.2 (January 2026) — wheels for Linux, macOS and Windows built by
  cibuildwheel, PyPI publishing from CI, an RNG seed for the C core, and
  initialisation fixes in the bindings. Start of AI help: OpenAI Codex
  (GPT-5.2-Codex). Yanked: the old vendored pybind11 does not work with numpy
  2.0.
- 0.2.1 (January 2026) — pybind11 updated; works with numpy 2.x.
- 0.2.2 (April 2026) — seed in the Python API and deterministic results
  with a fixed seed; LAF buffers allocated only when the check is enabled.
- 0.3.0 (August 2026) — fixes macOS builds, which had compiled out every
  LAPACK call, so local optimisation never ran (see the box below). Fixed-seed
  golden regression tests, dead-code cleanup, about 2x faster on public data at
  equal accuracy, the benchmarks/ suite, Python 3.14 wheels. AI help: Claude
  Fable 5 and Claude Opus 5.
- 0.3.1 (November 2026) — 1.1–2.1x faster than 0.3.0 at the same accuracy,
  AVX kernels chosen at run time on x86-64, the GIL released during estimation
  with thread-safe concurrent calls, examples that run on OpenCV 5. AI help:
  OpenAI Codex (GPT-6 Astra) and Claude Opus 5.5.

  macOS users: upgrade

 Every macOS build published before 0.3.0 silently skipped all of its
 LAPACK calls. The C sources guarded them behind ifdef _WIN32 / ifdef
 __linux__, and macOS defines neither, so the preprocessor removed them: the
 least-squares refits that local optimisation depends on returned an identity
 matrix (F) or an untouched covariance matrix (H). LO-RANSAC's local
 optimisation — the thing that makes this estimator worth using — never ran.

 Results were degraded, not broken, so nothing failed loudly: measured on
 public data it cost 0.11 mAA on fundamental and 0.21 on homography.
 Anything you benchmarked on macOS against other estimators was measuring a
 crippled build. Linux and Windows were unaffected.

 To check an existing install:

 bash
 nm -u $(python -c "import pydegensac,glob,os;print(glob.glo

Latest release

Speed optimizations. v_0.3.1 2026-11-11
1.2-2x faster than 0.3.0, same output

 - GIL released during estimation; thread-safety fixes in the degeneracy RNG and table init
  - Faster fixed-size solvers and degeneracy recovery, fewer allocations, pooled LO hash nodes
  - AVX kernels picked at run time on x86, bit-identical to the scalar path (PYDEGENSAC_SIMD=0 forces scalar)
  - Windows wheels use thread-safe OpenBLAS, so concurrent calls are safe
  - Examples switched from AKAZE to SIFT so they run on OpenCV 5

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON