A fast, robust, and async-friendly Rust implementation and optimization of the cedar-solve centroid extraction and plate solving algorithms.
This workspace is divided into two primary crates:
tetra3: The core algorithms.solver.rsis a Rust port of the Tetra3solve_from_centroidsfunction.extractor.rsis a Rust port of theget_centroids_from_imagefunction.tetra3.rsprovides the standard interface corresponding to the Python project.tetra3-py: Python bindings for the optimized tetra3 Rust implementation.server: A gRPC server that exposes tetra3's algorithms as a service.
- Rust / Cargo
- Python 3
To build the workspace:
cargo build --release
A set of real-world test data is provided for validating the algorithms and the wrappers.
From the project root, run:
cargo test --release -- --test-threads=1
Optionally add --nocapture to the end of the command above to print the full test ouput to stdout.
From the tetra3-py root, run:
./test_python_wrapper.sh
The solver tests provide a performance report at the end of the output:
cargo test --release test_solver_consistency_with_testdata -- --nocapture
To compare the extraction performance against the original cedar-solve implementation:
- Clone cedar-solve
- Run
./setup.shin thecedar-solveroot. - Source the Python activation script:
source ../cedar-solve/.cedar_venv/bin/activate
- From the repo root run:
cargo test --release test_performance_vs_python -- --nocapture --test-threads=1 --ignored
To compare the extraction performance against cedar-detect, run:
cargo test --release test_performance_vs_python -- --nocapture --test-threads=1 --ignored
1. Why not port the database generation function?
Database generation is a one-time operation that doesn't benefit from a port.
2. How can I generate an appropriate database?
Refer to cedar-solve or esa/tetra for database generation. Note that the 2 versions of tetra3 have slightly different database formats, but this Rust implementation is compatible with both.
3. What kind of performance gain can I expect to see for the solver?
On a Raspberry Pi 5 with 4 GB RAM the Rust version ~130x faster. On a Raspberry Pi Zero 2W with 512 MB of RAM the Rust version has a similar performance gain. In both cases solves in the cedar-server pipeline take well under 1 ms.
4. What kind of performance gain can I expect to see for the extractor?
Benchmarks on the Raspberry Pi 5 with 4 GB RAM show ~15x improvement over the extractor in cedar-solve.
5. How does the extractor port compare to cedar-detect?
cedar-detect is up to 2x as fast. The extractor port here uses the same algorithm as cedar-solve and produces the same results. cedar-detect provides a custom algorithm.
This project is licensed under the PolyForm Noncommercial License 1.0.0.
See LICENSE.md for full details.
All product names, trademarks and registered trademarks are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, trademarks and brands does not imply endorsement.
olive-solve is not affiliated with, endorsed by, or sponsored by Clear Skies Astro or the European Space Agency.
Cedar™ is a trademark of Clear Skies Astro, registered in the U.S. and other countries.