Giter Site home page Giter Site logo

leonbohmann / fracture-suite Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 38.11 MB

A small toolkit for analyzing fracture patterns on glass plys.

Home Page: https://leonbohmann.github.io/fracsuite-docs

Python 99.83% Batchfile 0.17%
analysis fracture glass tempered-glass fracture-patterns

fracture-suite's Introduction

Version Total Downloads DOI

For citation please use:

@software{fracture-suite,
  author       = {Leon Bohmann},
  title        = {fracsuite v1},
  data         = 2024-03,
  version      = {1.0.0},
  doi          = {10.5281/zenodo.10758208},
  url          = {https://github.com/leonbohmann/fracture-suite/tree/masterrelease}
}

Backend plot of analyzer, displaying original and preprocessed image and detected cracks

How it works

⚠️ This is deprecated. The documentation will be updated in the future!

Several steps are necessary to analyze a fracture scan:

  1. Cropping of input image (optional)
    1. Analyze the image and find the biggest rectangular shape
    2. Perspective transform the image, so that the rectangle is filling the extents
  2. Preprocessing
    1. Gaussian Blur + (optional) Resize of the input image
    2. Adaptive Threshold
  3. Contour detection
    1. Find all contours on the preprocessed image
    2. Filter Contours, remove all:
      1. Whose perimeter is too small
      2. Whose area is way too large (25000px²)
  4. Create stencil with the found contours
    1. This helps to quickly remove all contours that lie within a bigger contour
    2. Draw all contours onto a new image (resulting image will display the cracks)
  5. Skeletonization #1
    1. Skeletonize the stencil to minimize the crack width to 1px wide lines
    2. Use Erode/Dilate (closing kernel) to connect gaps in contours (this will widen the 1px wide lines)
  6. Skeletonization #2
    1. Skeletonize the image again to retrieve the crack middle lines
  7. (enabled by default) Remove splinters, whose are is all black in the original image and fill those spaces
  8. Contour detection #2
    1. Now with minimal fuzziness, run the splinter detection again
  9. 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)

fracture-suite's People

Contributors

leonbohmann avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.