HAPPY.crack_path module
- class HAPPY.crack_path.My_MCP(costs, offsets=None, fully_connected=True, distance_weight=0)[source]
- HAPPY.crack_path.det_crack_path(thres, crop_threshold, num_runs, kernel_size, distance_weight=0)[source]
Determine possible crack paths in the micrograph.
- Parameters
thres (array) – thesholded image to look at
crop_threshold (array) – calculated during thresholding, array of true and false values
num_runs (int) – number of crack paths to determine
kernel_size (int) – Once a crack is found, all future paths must be at least kernel_size away from it.
distance_weight (float) – Crack paths should follow hydrides but only up to a point: they should also be short. This weight determines how much the “shortness” consideration should count compared to the hydride. Higher weight => shorter paths.
- Returns
edist (array) – min euclidean distace from the hydride to the matrix
path_list – list of possible crack paths
cost_list (list) – list of cost values for each crack path