Skip to main content

Fast sphericity and roundness in 2D and 3D using local thickness

Project description

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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_rs-1.0.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_rs-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file fast_rs-1.0.0.tar.gz.

File metadata

  • Download URL: fast_rs-1.0.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for fast_rs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62d9d7b22e4d3e3fd3da7c013b71bdcd944d835f1b31f0467adad02966f7c34f
MD5 b3d8dc5c01d34c39ab58a9e558cde10f
BLAKE2b-256 13e8505a1dac339c5fa53694ab8f46335835f1dfe2dc017812b760d4a9af5804

See more details on using hashes here.

File details

Details for the file fast_rs-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fast_rs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for fast_rs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cb12669f0454a1366bfe7311ad9c2374476effe8326b9f798b82d7f06dc4ebb
MD5 771712624bd49b72ce4b144019d9348d
BLAKE2b-256 623219527f8d713dac6f5cc68bfa0b782b89edf7d58c2fe6714bd508294b649c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page