最初的理解
- “边缘”像素点和临近像素的差异较大
- 受噪声影响大
- 所以需要降噪(高斯模糊算法)
- 可以利用导数和梯度的方式计算。在矩阵中可以利用卷积的方式近似。超过一定阈值判断为边缘。
Gradient operators(梯度算子)
参考资料:边缘检测的各种微分算子比较(Sobel,Robert,Prewit...)
Prewitt Edge Detector
Sobel Edge Detector
Marr Hildreth Edge Detector
- 使用高斯模糊并使用拉普拉斯算子,即梯度的散度(更加复杂的模糊算法)
- 找到zero-crossing点
参考资料可以认为zero-crossing点届时二阶导数为0的点
Canny Edge Detector
以下是该边缘检测器致力于达到的目标:
- Good Detection: The optimal detector must
minimize the probability of false positives as well as false
negatives.(大概是尽可能减少噪音的影响) - Criterion 2: Good Localization: The edges detected must
be as close as possible to the true edges.(更为准确的定位) - Single Response Constraint: The detector must return
one point only for each edge point.(对一条边上的点仅响应一个点)
step:
- Smooth image with Gaussian filter
使用高斯模糊(高斯滤波器) - Compute derivative of filtered image
- Find magnitude and orientation of gradient
(计算梯度,方向&大小,即模)
- Apply “Non-maximum Suppression”
图片数学公式中的delta全部换成梯度符号
取疑似边缘的点中梯度最大的那个(normal direction:法线方向)
- Apply “Hysteresis Threshold”(滞后阈值)
![]()
判断边缘的时候使用了两个阈值,高于HIGH阈值时直接判断为edge pixel(边缘点),低于Low阈值时则直接排除,在两者之间的像素点,如果和edge pixel直接相连,或者和另一个也是在LOW与HIGH之间的点相连。
算法的实现思想:
网友评论