This repository provides Python bindings for the easySBA sparse bundle adjustment C library, using pybind11.
src/– Original C/C++ sources for the easySBA library and the license.easysba/– Python package:__init__.pyre-exportseasy_sbafrom the compiled pybind11 extension (_easysba.cpp).tests/–unittest-based test suite run withpytest.docs/– Usage documentation (USAGE.md).pyproject.toml/setup.py– Build configuration (setuptools + pybind11 C extension, cibuildwheel for wheels).
- Python 3.11+
- C/C++ toolchain
- BLAS/LAPACK development libraries (e.g.
libblas-dev,liblapack-dev,liblapacke-dev) - Python packages:
numpy,pybind11,setuptools,wheel
On Ubuntu/Debian:
sudo apt-get install -y build-essential libblas-dev liblapack-dev liblapacke-dev gfortranInstall the package locally (editable or regular):
pip install -v .
# or with uv
uv pip install -v .pytestTests that actually run the SBA solver require the environment variable EASYSBA_RUN_SOLVER=1:
EASYSBA_RUN_SOLVER=1 pytest- Python code follows standard PEP 8 conventions.
- C/C++ code in
src/andeasysba/_easysba.cppfollows the style of the existing sources. - Tests live in
tests/and useunittest.TestCaseclasses, discovered and run viapytest. - Keep the public Python API minimal:
easysba.easy_sba(...)is the single entry point.
| File | Purpose |
|---|---|
easysba/_easysba.cpp |
pybind11 binding: wraps the C easy_sba function |
easysba/__init__.py |
Re-exports easy_sba for the public package API |
src/sba_levmar.c |
Core Levenberg-Marquardt SBA implementation |
tests/test_smoke.py |
Smoke tests (import check + optional solver run) |
tests/test_sba_steps.py |
Step-by-step SBA tests |
pyproject.toml |
Build system and cibuildwheel configuration |