图像处理(10)综合各种高级算子
下面来介绍Scharr算子,他和sobel算子类似,只不过矩阵的边缘检测敏感度不同,也就是赋值更敏感。
\begin{equation*}
\text{Scharr}(x,y) = \frac{3}{2} \left[ \text{Sobel}(x+1,y+1) - \text{Sobel}(x-1,y-1) \right] - \frac{1}{2} \left[ \text{Sobel}(x+1,y-1) - \text{Sobel}(x-1,y+1) \right]
\end{equation*}
这是什么玩意,通俗的说,就是这样。
\begin{equation*}
G_x(x) =
\begin{bmatrix}
-3 & 0 & 3 \
-10 & 0 & 10 \
-3 & 0 & 3
\end{bmatrix} \ , \
G_y(x) =
\begin{bmatrix}
3 & 10 & 3 \
0 & 0 & 0 \
-3 & -10 & -3
\end{bmatrix}
\end{equation*}
也就是说用了近大远小的道理,中间都是10,角上是3,更加对边缘敏感。
1 | import cv2 as cv |
1 | img = cv.imread("def.jpg", cv.IMREAD_GRAYSCALE) |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment