Package to help analyze fracture patterns on broken glass plys.
Project description
Fracture Suite
This package helps identifying splinters on broken glass plys.
It performs several operations on the input image to enhance the visibility of scanned cracks and analyzes contours in the image. Filtering then helps to remove unwanted artifacts like dust speckles or glue residue. The remaining contours are then used to calculate the size (in px) as well as the round- and rough-ness of the splinter.
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
- Contour detection #2
- Now with minimal fuzziness, run the splinter detection again
- Create splinters from resulting contour list
Installation
pip install fracsuite
Usage
For details see: API Docs
Use the module directly
py -m fracsuite.splinters -image "path/to/image" [--crop]
-image
The path to the image
--crop
If the image contains unfiltered area around the ply, use this to crop the image to the ply.
Create a script
from fracsuite.splinters.analyzer import Analyzer
image = r"Path/to/some/image.bmp"
crop = True
analyzer = Analyzer(image, crop)
analyzer.plot()
analyzer.plot_area()
analyzer.plot_area_2()
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
Hashes for fracsuite-0.1.5a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176784ef32bf6e70fd994a8da37b114a8dab7f40cbb4aa8a9af705ddf08189e0 |
|
MD5 | 2a0a70a35d4843f9bd0e9fc8e63d24f4 |
|
BLAKE2b-256 | 697ca328a1be3e7ee7871acc1f6c7df410005d7d3f1f22d1d204282cb4682396 |