Canny算子的非极大值抑制Non-maximum Suppression
Non-maximum Suppression
After getting gradient magnitude and direction, a full scan of image is done to remove any unwanted pixels which may not constitute the edge. For this, at every pixel, pixel is checked if it is a local maximum in its neighborhood in the direction of gradient. Check the image below:
在得到梯度大小和方向后,对图像进行全扫描,去除可能不构成边缘的任何不想要的像素。为此,在每个像素处,像素在梯度方向上是否为其邻域内的局部最大值。检查下面的图像:
Point A is on the edge ( in vertical direction). Gradient direction is normal to the edge. Point B and C are in gradient directions. So point A is checked with point B and C to see if it forms a local maximum. If so, it is considered for next stage, otherwise, it is suppressed ( put to zero).
In short, the result you get is a binary image with "thin edges".
上图中左边的为边缘,右边的因为A和C之间的极大值约等于A和B的极大值,所以右图中垂直A的线就不是,会被抑制。