detect_cracks_bender

detect_cracks_bender(images, theta=0, crack_width=10, threshold=0.96, min_size=None)[source]

Crack detection algorithm by J.J. Bender.

This crack detection algorithm only works on an image stack with consecutive images of one specimen. The first image is used as the background image. No cracks are detected in the first image. The images must be aligned for this algorithm to work correctly. Cracks can only be detected in grayscale images with the same shape.

Parameters
images: ImageStack, list

Image stack or list with consecutive grayscale images (np.ndarray) of the same shape and aligned.

theta: float

Angle of the cracks in respect to a horizontal line in degrees

crack_width: int

The approximate width of an average crack in pixel. This determines the width of the detected features.

threshold: float, optional

Threshold of what is perceived as a crack after all filters. E.g. 0.96 means that all gray values over 0.96 in the filtered image are cracks. This value should be close to 1. A lower value will detect cracks with a weak signal but more artefacts as well. Default: 5

min_size: int, optional

The minimal number of pixels a crack can be. Cracks under this size will not get counted. Default: 5

Returns
rho_c: float

Crack density [1/px]

cracks: np.ndarray

Array with the coordinates of the crack with the following structure: ([[x0, y0],[x1,y1], […]]) where x0 and y0 are the starting coordinates and x1, y1 the end of one crack. Each crack is represented by a 2x2 array stacked into a bigger array (x,2,2).

rho_th: float

A measure how much of the area of the input image is detected as foreground. If the gabor filter can not distinguish between cracks with very little space in between the crack detection will break down and lead to false results. If this value is high but the crack density is low, this is an indicator that the crack detection does not work with the given input parameters and the input image.