/radon-transform

Radon transform implementation in Rust and Python.

Primary LanguageJupyter Notebook

Radon transform | Rust & Python

rustc rustc

Implementation of the Radon transform in Python and Rust.

The main goal of this repository is to benchmark an algorithmically identical implementation of the Radon transform in Python and Rust.

See pyradon for Python bindings of this implementation.

animated

Benchmark

image_size: 512x512
number of rays: 200
number of slopes: 200
n_trials: 10

python
    mean: 4639.79 ms, var: 0.09
rust
    mean: 23.80 ms, var: 0.57

How to use

Run commands below in order to run benchmarks in Python and Rust.

Python

cd py & python benchmark.py

Rust

cargo run --bin benchmark --release

Notes

  1. As usually done, this radon transform only computes rays with angles going from -pi/4 to pi/4 for numerically accurate integration along slopes. In order to compute the complete radon transform, apply the transform on the transposed image and merge the split transforms.
  2. The integration is computed using the nearest method.