explaingit

ducha-aiki/ds-sac

Analysis updated 2026-07-26

2PythonAudience · researcherComplexity · 2/5Setup · easy

TLDR

A Python tool that lines up two images by finding matching points between them. Unlike standard methods, it gives you the exact same answer every time you run it, with no randomness.

Mindmap

mindmap
  root((repo))
    What it does
      Finds image transforms
      Deterministic results
      Batch processing
    Tech stack
      Python
      NumPy
      Numba optional
    Use cases
      Image alignment
      Reproducible research
      Panorama stitching
    Audience
      Computer vision devs
      Researchers
    Performance
      Slower than fastest
      Competitive accuracy
      Bit-exact reproducible

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Stitch multiple photos together into a panorama by finding matching points.

USE CASE 2

Get bit-exact reproducible image alignment results for research experiments.

USE CASE 3

Process many image pairs in batch using multi-core CPUs.

USE CASE 4

Align images for 3D reconstruction pipelines where consistency matters.

What is it built with?

PythonNumPyNumba

How does it compare?

ducha-aiki/ds-sac0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPythonPython
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audienceresearchergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Only needs Python and NumPy, installing the optional numba package speeds things up significantly but is not required.

The license is not specified in the repository documentation.

In plain English

This repository re-implements a computer vision algorithm called DS-SAC, which stands for Density Search for Sample Consensus. The specific case handled here is homography estimation, a common task where you find the geometric transform that maps one image to another using matching feature points. The code is an independent, from-scratch implementation based on a research paper, not the original authors' code, and it has not been checked against the official version. Most methods for this task use randomness, trying many small samples and hoping to find a good fit. DS-SAC takes a different approach: it is fully deterministic, meaning it produces the exact same result every time you run it with the same inputs. It starts with a broad fit on all points, then searches by progressively shrinking the point set to smaller top-percentile slices. It expands back out from the best slice, splits the points into separate groups based on how they deviate from the current model, and finishes with a refinement pass that gradually tightens the acceptance threshold. The code is written in Python and depends only on NumPy, a standard numerical library. Installing an optional package called numba makes the same logic run roughly nine times faster. Using it involves passing in two arrays of matching point coordinates and a threshold, and the function returns a 3x3 transform matrix plus a list indicating which points were inliers. There is also a batch interface for processing many pairs of images at once using multiple CPU cores. Benchmark results are included, comparing DS-SAC against three established alternatives, OpenCV RANSAC, MAGSAC++, and pydegensac, on two small standard test sets. DS-SAC lands in the middle of the pack: slower than the fastest baseline but ahead of one, with competitive accuracy. The results note that the test sets are small, so differences of a few percent should be treated as noise. A key practical advantage noted is that DS-SAC is bit-exact reproducible, whereas the randomized baselines vary slightly between runs. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using the DS-SAC Python library, write a script that takes two image file paths, extracts feature points with OpenCV, and uses ds_sac to compute the homography matrix. Print the 3x3 matrix and the number of inlier points.
Prompt 2
I need to align two images deterministically and get the same result every run. Show me how to pass two NumPy arrays of matching point coordinates to DS-SAC with a threshold of 3.0 and retrieve the transform matrix.
Prompt 3
Write a batch processing script using DS-SAC's batch interface that takes a list of image pairs, uses multiprocessing across CPU cores, and outputs the homography matrix for each pair to a JSON file.
Prompt 4
Install the DS-SAC library with the optional numba package for speed. Compare how long it takes to run on 100 image pairs with and without numba enabled.

Frequently asked questions

What is ds-sac?

A Python tool that lines up two images by finding matching points between them. Unlike standard methods, it gives you the exact same answer every time you run it, with no randomness.

What language is ds-sac written in?

Mainly Python. The stack also includes Python, NumPy, Numba.

What license does ds-sac use?

The license is not specified in the repository documentation.

How hard is ds-sac to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is ds-sac for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.