Skip to main content

The StereoFractAnalyzer class in this package is designed for fractal dimension analysis of both 3D meshes from STL files and 2D images, incorporating functionalities for geometric transformations, visualization, and fractal dimension calculation using the box counting method. It leverages libraries like open3d, numpy, matplotlib, and PIL for processing and supports command-line arguments for user convenience.

Reason this release was yanked:

CLI not working

Project description


StereoFractAnalyzer

StereoFractAnalyzer is a Python package designed for analyzing the fractal dimension of 3D surfaces and 2D images. It finds applications across various fields such as material science, geology, and computer graphics. Utilizing the capabilities of Open3D, NumPy, Matplotlib, and PIL, it offers a robust suite of tools for comprehensive fractal geometry analysis.

Features

  • 3D Model Analysis: Load and analyze 3D models from STL files to study their surface complexity.
  • Voxel Grid Conversion: Convert 3D models into voxel grids to facilitate volumetric analysis.
  • Fractal Dimension Calculation: Determine the fractal dimension of both 3D surfaces and 2D binary images to quantify their complexity.
  • Visualization Tools: Utilize visualization capabilities to inspect 3D models, voxel grids, and contour slices of your analytical models.
  • Contour Drawing: Generate and visualize contours of 3D meshes at specified z-heights, aiding in the understanding of surface features.
  • Surface and Image Complexity Estimation: Estimate the roughness or complexity of surfaces and images through detailed fractal analysis.

Installation

Ensure you have Python 3.6 or higher installed on your system. Install StereoFractAnalyzer using pip:

pip install StereoFractAnalyzer

Dependencies

StereoFractAnalyzer requires the following libraries:

  • open3d
  • numpy
  • matplotlib
  • Pillow

Install these dependencies directly using pip if not already installed:

pip install open3d numpy matplotlib Pillow

Usage

Analyzing a 3D Model

To compute the fractal dimension of a 3D surface:

from StereoFractAnalyzer import StereoFractAnalyzer

analyzer = StereoFractAnalyzer(stl_path="path/to/your/model.stl")
surface_fractal_dimension = analyzer.get_surface_fractal_dimension()
print(f"Surface fractal dimension: {surface_fractal_dimension}")

Analyzing a 2D Image

For fractal dimension analysis of a 2D binary image:

from StereoFractAnalyzer import StereoFractAnalyzer

analyzer = StereoFractAnalyzer(img_path="path/to/your/image.png")
fractal_dimension = analyzer.get_image_fractal_dimension(plot=1)
print(f"The fractal dimension of the image is: {fractal_dimension}")

Command Line Interface

StereoFractAnalyzer's CLI allows for direct terminal-based operations for both 3D and 2D analyses.

3D Model Analysis

Analyze a 3D model from an STL file:

python -m StereoFractAnalyzer --stl path/to/your/model.stl

2D Image Analysis

Calculate the fractal dimension of a 2D binary image:

python -m StereoFractAnalyzer --img path/to/your/image.png

Combined Analysis

Conduct analyses on both a 3D model and a 2D image in one command:

python -m StereoFractAnalyzer --stl path/to/your/model.stl --img path/to/your/image.png

Help and Options

For a detailed list of options and help:

python -m StereoFractAnalyzer --help

This displays all command-line options available, providing guidance on how to use the CLI effectively.

Contributing

Contributions are welcome! If you have suggestions for improvements or bug fixes, feel free to fork the repository and submit a pull request.

License

StereoFractAnalyzer is open-source software licensed under the MIT License. See the LICENSE file for more details.


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

StereoFractAnalyzer-0.1.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

StereoFractAnalyzer-0.1.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file StereoFractAnalyzer-0.1.1.tar.gz.

File metadata

  • Download URL: StereoFractAnalyzer-0.1.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for StereoFractAnalyzer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d7476d87872f809eb55b5b028e417268de55e3e3b8b49d6f7ffe02ab6108a31
MD5 1703b184c5fcb787212c88e9025c0b3b
BLAKE2b-256 e622300d67be5ead49d99e95b15911461570ae0fe0137bb32272b8723ab2559f

See more details on using hashes here.

File details

Details for the file StereoFractAnalyzer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for StereoFractAnalyzer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 746cba4b9ca696c3891d74a9f8d6ad5de9adbe062233c6cefb901acbfb50845e
MD5 d55b3f084cef61fcfe4d809ba9a50d99
BLAKE2b-256 ccd22f7945d6fb6be249761801786b9e319944bce95e38b2fc0659ca2d04b347

See more details on using hashes here.

Supported by

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