应用
[Edge detection]
Prewitt & sobel 适合unit image, all white image, single color image.
[Corner detecction]
https://medium.com/k-r-i-s-s/edge-corner-detection-7db111bc5856
例子 1
来自Github:https://github.com/lina-haidar/Image-Gradient-with-Python
使用numpy 里的convolution operants np.lib.stride_tricks.as_strided
& np.einsum('ij,ijkl->kl', filter, as_strided_result)
去获得通过X Filter 或者 Y Filter sliding 整个画面的结果(并且Output的size放大8倍)
- Step1 :原始图片
- image size = 100x100
- Step2 : Gray:
- image size = 100x100
- Step3 : X Filter result:
- [ 0 0 0 − 1 0 1 0 0 0 ] \begin{bmatrix} 0 & 0 & 0 \\ -1 & 0 & 1\\ 0 & 0 & 0 \\ \end{bmatrix} ⎣