Skip to main content

Fast sphericity and roundness approximation in 2D and 3D

Fast approximation of Wadell sphericity and roundness in 2D and 3D, described in our paper (link), (arXiv).

The method uses the output from local thickness algorithm to approximate the two measures. Resulting sphericity values closely match those from exact approaches. Roundness values no longer retain the original 0-1 range, but correlate closely to it.

The execution speed is dependent primarily on image volume, and not on number of objects, enabling fast evaluation of thousands of objects at once.

For in-depth introduction to the library, visit the CodeOcean capsule.

Installation

pip install fast_rs

How to use

For in-depth introduction, visit the CodeOcean capsule.

Both sphericity and roundness can be calculated together, from a binary mask. The process is exactly the same in 2D and 3D.

from fast_rs import rs

mask = ... # Load/provide binary mask (can be both a 2D and 3D np.array)
roundness_vec, sphericity_vec, label_img = rs.rs_calculate(mask)

Returned label image indices can be used to connect measure values to specific objects in the mask.

Example result:

Demo result of roundness and sphericity

Paper

The fast sphericity and roundness approximation method is described and evaluated in our contribution to CVMI (CVPR 2025 Workshop). Please cite our paper if you use the method in your work.

@article{pieta2025a,
  author = {Pieta, Pawel Tomasz and Rasmussen, Peter Winkel and Dahl, Anders Bjorholm and Christensen, Anders Nymark},
  title = {Fast Sphericity and Roundness Approximation in 2D and 3D Using Local Thickness},
  language = {eng},
  format = {article},
  journal = {Proceedings of 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
  pages = {4667-4677},
  year = {2025},
  publisher = {IEEE},
  doi = {10.1109/CVPRW67362.2025.00453}
}

License

MIT License (see LICENSE file).

Metadata

Release files for fast-rs 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast-rs 1.0.0
File Size Uploaded Provenance Actions
fast_rs-1.0.0.tar.gz 5.7 kB Without provenance Details for fast_rs-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fast-rs 1.0.0
File Interpreter ABI Platform Actions
fast_rs-1.0.0-py3-none-any.whl Python 3 none any Details for fast_rs-1.0.0-py3-none-any.whl

Total release size: 11.8 kB

Release files / fast_rs-1.0.0.tar.gz

Download URL fast_rs-1.0.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
62d9d7b22e4d3e3fd3da7c013b71bdcd944d835f1b31f0467adad02966f7c34f
BLAKE2b-256 checksum
How to use checksums
13e8505a1dac339c5fa53694ab8f46335835f1dfe2dc017812b760d4a9af5804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Release files / fast_rs-1.0.0-py3-none-any.whl

Download URL fast_rs-1.0.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb12669f0454a1366bfe7311ad9c2374476effe8326b9f798b82d7f06dc4ebb
BLAKE2b-256 checksum
How to use checksums
623219527f8d713dac6f5cc68bfa0b782b89edf7d58c2fe6714bd508294b649c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.4

Security for fast-rs 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page