为什么需要进行 edge detection?
- 从像素进阶到 features
- edge 意味着变化,而变化意味着信息
- gradient (梯度) becomes large, and curvature (曲率) becomes small
通常包含几个步骤:
- Edge Filtering
- Edge Detection
- Edge Linking
Prewitt 算子与 Sobel 算子
Prewitt 算子和 Sobel 算子是卷积核,可以有效提取 Gradient 较大的区域
Prewitt 算子:
Prewitt1=−101−101−101Prewitt2=−1−1−1000111Sobel 算子:
Sobel1=−101−202−101Sobel2=−1−2−2000121
- 优势
- 劣势
- 对噪声敏感
- 边缘粗细不一致、strength 不一致
Laplacian of Gaussian (LoG)
我们先对图像应用 Gaussian Blur 进行平滑处理以降低 Laplacian 操作对于噪声的敏感性
我们首先对图像进行 Gaussian Blur,式子可以写作
h(r)=−exp(−2σ2r2),r2=x2+y2接着,对 Gaussian Blur 过的图像进行 Laplacian 操作
∇2h(r)=∂x2∂2h+∂y2∂2h=−σ4r2−2σ2⋅exp(−2σ2r2)不过真正在计算的时候,我们通常用一个卷积核来近似 LoG 操作,例如
LoG1=0−10−14−10−10LoG2=−1−1−1−18−1−1−1−1 Canny Edge Detector