Introduction - If you have any usage issues, please Google them yourself
The basic step of edge detection algorithm
(1) filtering. Edge detection is mainly based on derivative calculation, but is affected by noise. But the filter also causes the loss of edge strength while reducing noise. (2) enhancement. The enhancement algorithm shows that the gray scale has significant change in the neighborhood. Generally, the gradient amplitude is calculated.
(3) detection. But in some images the gradient is not the edge. The simplest edge detection is the determination of gradient amplitude threshold.
(4) positioning. Pinpoint the location of the edge.
Canny edge detection algorithm
Step1: smooth image with gaussian filter;
Step2: calculate the amplitude and direction of the gradient using the finite difference of first-order partial derivatives;
Step3: nonmaximum value suppression for gradient amplitude;
Step4: detection and connection edge with double threshold algorithm.