canny edge detection

 It is recommended to take it with the video:

 2.canny edge detection (canny edge detection)_bilibili_bilibili

1. Common convolution kernels

Summary of commonly used image convolution kernel types_Gaussian convolution kernel-CSDN Blog

1 Gaussian convolution kernel

 Two-dimensional normal (Gaussian) distribution 

It is linearly separable, can be smoothed, and can remove random noise.

Pixels will be affected by surrounding pixels, so using a Gaussian convolution kernel can remove noise to a certain extent.

2 Sobel convolution kernel

 

2. Edge detection 

1 Gaussian kernel convolution denoising:

2 Edge judgment:

 The edge has the greatest rate of change. The derivation is the largest, but there is no way to derivation for pixels because it is a discrete value. Therefore, the difference quotient is used instead. The pixel distance is the same, so the pixel difference is also the same.

 This is the principle of sobel.

3 Non-maximum suppression:

Linear interpolation method simulates g1 and g3. See whether point c is the maximum value.

4 Grayscale threshold setting:

Remove some extreme values ​​that may not be edges: dual threshold setting

 Edge connection: See that there is a reserved extreme value in its eight fields, connecting them both. The data structure uses a stack.

3. Code learning

I haven’t learned yet, but I have learned to write.

Guess you like

Origin blog.csdn.net/qq_46012097/article/details/134087529