digital_image_processing.edge_detection.canny

Attributes

PI

lena

Functions

canny(image[, threshold_low, threshold_high, weak, strong])

detect_high_low_threshold(image_shape, destination, ...)

High-Low threshold detection. If an edge pixel's gradient value is higher

gen_gaussian_kernel(k_size, sigma)

suppress_non_maximum(image_shape, gradient_direction, ...)

Non-maximum suppression. If the edge strength of the current pixel is the largest

track_edge(image_shape, destination, weak, strong)

Edge tracking. Usually a weak edge pixel caused from true edges will be connected

Module Contents

digital_image_processing.edge_detection.canny.canny(image, threshold_low=15, threshold_high=30, weak=128, strong=255)
digital_image_processing.edge_detection.canny.detect_high_low_threshold(image_shape, destination, threshold_low, threshold_high, weak, strong)

High-Low threshold detection. If an edge pixel’s gradient value is higher than the high threshold value, it is marked as a strong edge pixel. If an edge pixel’s gradient value is smaller than the high threshold value and larger than the low threshold value, it is marked as a weak edge pixel. If an edge pixel’s value is smaller than the low threshold value, it will be suppressed.

digital_image_processing.edge_detection.canny.gen_gaussian_kernel(k_size, sigma)
digital_image_processing.edge_detection.canny.suppress_non_maximum(image_shape, gradient_direction, sobel_grad)

Non-maximum suppression. If the edge strength of the current pixel is the largest compared to the other pixels in the mask with the same direction, the value will be preserved. Otherwise, the value will be suppressed.

digital_image_processing.edge_detection.canny.track_edge(image_shape, destination, weak, strong)

Edge tracking. Usually a weak edge pixel caused from true edges will be connected to a strong edge pixel while noise responses are unconnected. As long as there is one strong edge pixel that is involved in its 8-connected neighborhood, that weak edge point can be identified as one that should be preserved.

digital_image_processing.edge_detection.canny.PI = 180
digital_image_processing.edge_detection.canny.lena