Package to help analyze fracture patterns on broken glass plys.
Project description
For citation please use:
@software{fracture-suite, author = {Leon Bohmann}, title = {leonbohmann/fracture-suite: 0.1.7}, month = sep, year = 2023, publisher = {Zenodo}, version = {0.1.7}, doi = {10.5281/zenodo.8369156}, url = {https://doi.org/10.5281/zenodo.8369156} }
How it works
Several steps are necessary to analyze a fracture scan:
- Cropping of input image (optional)
- Analyze the image and find the biggest rectangular shape
- Perspective transform the image, so that the rectangle is filling the extents
- Preprocessing
- Gaussian Blur + (optional) Resize of the input image
- Adaptive Threshold
- Contour detection
- Find all contours on the preprocessed image
- Filter Contours, remove all:
- Whose perimeter is too small
- Whose area is way too large (25000px²)
- Create stencil with the found contours
- This helps to quickly remove all contours that lie within a bigger contour
- Draw all contours onto a new image (resulting image will display the cracks)
- Skeletonization #1
- Skeletonize the stencil to minimize the crack width to 1px wide lines
- Use Erode/Dilate (closing kernel) to connect gaps in contours (this will widen the 1px wide lines)
- Skeletonization #2
- Skeletonize the image again to retrieve the crack middle lines
- (enabled by default) Remove splinters, whose are is all black in the original image and fill those spaces
- Contour detection #2
- Now with minimal fuzziness, run the splinter detection again
- Create splinters from resulting contour list
A couple of outputs are saved to a directory next to the input image. These are:
- Contour plot of recognized splinters (you have to zoom in, contour thickness is 1px)
- Filled plot of splinters
- Figures
- Splinter size distribution
- Splinter relative share distribution
- Voronoi overview
- Fracture Intensity overlay
Installation
pip install fracsuite
Usage (:warning: 0.1.7 only!)
Use the module directly
py -m fracsuite.splinters "path/to/image"
For details see: API Docs
Create a script
from fracsuite.splinters.analyzer import Analyzer, AnalyzerConfig
image = r"Path/to/some/image.bmp"
config = AnalyzerConfig()
# size of cropped image (if cropping is needed)
config.cropsize = (4000,4000)
analyzer = Analyzer(image, config)
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
fracsuite-0.2.0.tar.gz
(193.4 kB
view hashes)
Built Distribution
fracsuite-0.2.0-py3-none-any.whl
(216.2 kB
view hashes)
Close
Hashes for fracsuite-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99fd3de9abc99a5a99d1e5e49fab4880a3892b4f2ddf702c97ac2ba323492526 |
|
MD5 | 623418b026ce8ddc6b935d9ee224513a |
|
BLAKE2b-256 | db4022124204a48b4e7f6647f909225096b484496dd327490dcc53b61159fe0f |