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.
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:
StereoFractAnalyzer --stl path/to/your/model.stl
2D Image Analysis
Calculate the fractal dimension of a 2D binary image:
StereoFractAnalyzer --img path/to/your/image.png
Combined Analysis
Conduct analyses on both a 3D model and a 2D image in one command:
StereoFractAnalyzer --stl path/to/your/model.stl --img path/to/your/image.png
Help and Options
For a detailed list of options and help:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file StereoFractAnalyzer-1.0.0.tar.gz
.
File metadata
- Download URL: StereoFractAnalyzer-1.0.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 467816efd4cf73e1edbb50583f73401a4d2b58f5233cf45bd8f745c50ba1f441 |
|
MD5 | 6d284b8ddd4877f87ea93bec7766f31f |
|
BLAKE2b-256 | d0027fb635f2b6f815fe81c4134ff29413a7556a53b5d36f22ee9f85a44af7c3 |
File details
Details for the file StereoFractAnalyzer-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: StereoFractAnalyzer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8020e19152f979f23e2cfd4a821366cc0482ca764f4716eac0365c4fd723fdf1 |
|
MD5 | e53d925b3d9c847ffa9dfbd6dfaaeaf7 |
|
BLAKE2b-256 | 9da86fd8fab96a28afb82f1abfc1f41c97edb8ce007d3ca9146a2a100272fdf1 |