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 (arXiv link).

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 git+https://github.com/PaPieta/fast_rs.git

Prerequisites

Library requires numpy, scipy, scikit-image, localthickness. They can be installed via provided requirements file:

  pip install -r requirements.txt

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_calulate(mask)

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

Example result:

drawing

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.

TBA: Official publication link

@article{pieta2025,
      title={Fast Sphericity and Roundness approximation in 2D and 3D using Local Thickness}, 
      author={Pawel Tomasz Pieta and Peter Winkel Rasumssen and Anders Bjorholm Dahl and Anders Nymark Christensen},
      year={2025},
      eprint={2504.05808},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2504.05808}, 
}

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-0.1.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-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fast_rs-0.1.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4067ed502d3d6855ce5459575946b410efd02e3719c3df568d3016e913a6306
MD5 2ae6a44776040d971cd23cab253ef7fc
BLAKE2b-256 b253c1e4bf6401992db3166866e2401a7836b680b2b5bacaa93da7b26171a0d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fast_rs-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7209c6178f1e896715363ac7b27103bd836138f5cda68e857d98be13d3d861b4
MD5 8d6635c9a08af783edaf1caf7abd4aa3
BLAKE2b-256 76991d1d0a43e3374c65ac75da06df1922d33509cc8d13e68d0a679b70f18cff

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