dicspecklequality.py

class DICSpeckleQuality(pattern, subset_size, subset_step, gray_level)[source]

Bases: object

__init__(pattern, subset_size, subset_step, gray_level)[source]
mean_intensity_gradient()[source]

Mean Intensity Gradient. Based on the below: https://www.sciencedirect.com/science/article/abs/pii/S0143816613001103

Returns: mean_intensity_gradient (float): float value for mean_intensity gradient

shannon_entropy()[source]

shannon entropy for speckle patterns. Based on the below: https://www.sciencedirect.com/science/article/abs/pii/S0030402615007950

Returns: shannon_entropy (float): float value for shannon entropy

gray_level_histogram()[source]

Count the number of occurrences of each gray value. plot results as a histogram

speckle_size()[source]

Calculates the Speckle sizes using a binary map calculaed from otsu threshholding (https://learnopencv.com/otsu-thresholding-with-opencv/)

Returns: tuple containing: num_speckles (int): total number of speckles identified in the binary map equivalent_diameters (np.ndarray): Speckle diameter if circle with same area labeled_speckles (np.ndarray): Label of the connected elements within speckle

speckle_size_plot()[source]
balance_subset()[source]
balance_image()[source]
balance_subset_avg()[source]
balance_subset_plot()[source]
extract_subset(image, x, y, subset_size)[source]

Parameters x (int): x-coord of subset center in image y (int): y-coord of subset center in image