问题描述
我使用大小为3x3的sobel过滤器来计算图像导数。看看在互联网上的一些文章,似乎内核为sobel过滤器的大小5x5和7x7也很常见,但我不能找到他们的内核值。
I am using a sobel filter of size 3x3 to calculate the image derivative. Looking at some articles on the internet, it seems that kernels for sobel filter for size 5x5 and 7x7 are also common, but I am not able to find their kernel values.
有人可以让我知道大小为5x5和7x7的sobel过滤器的内核值吗?此外,如果有人可以共享生成内核值的方法,这将非常有用。
Could someone please let me know the kernel values for sobel filter of size 5x5 and 7x7? Also, if someone could share a method to generate the kernel values, that will be much useful.
提前感谢。
推荐答案
Google似乎收到了大量的结果,例如
为3x3,5x5,7x7和9x9建议使用以下内核:
Google seems to turn up plenty of results, e.g.http://rsbweb.nih.gov/nih-image/download/user-macros/slowsobel.macro suggests the following kernels for 3x3, 5x5, 7x7 and 9x9:
3x3:
1 0 -1
2 0 -2
1 0 -1
5x5:
2 1 0 -1 -2
3 2 0 -2 -3
4 3 0 -3 -4
3 2 0 -2 -3
2 1 0 -1 -2
7x7:
3 2 1 0 -1 -2 -3
4 3 2 0 -2 -3 -4
5 4 3 0 -3 -4 -5
6 5 4 0 -4 -5 -6
5 4 3 0 -3 -4 -5
4 3 2 0 -2 -3 -4
3 2 1 0 -1 -2 -3
9x9:
4 3 2 1 0 -1 -2 -3 -4
5 4 3 2 0 -2 -3 -4 -5
6 5 4 3 0 -3 -4 -5 -6
7 6 5 4 0 -4 -5 -6 -7
8 7 6 5 0 -5 -6 -7 -8
7 6 5 4 0 -4 -5 -6 -7
6 5 4 3 0 -3 -4 -5 -6
5 4 3 2 0 -2 -3 -4 -5
4 3 2 1 0 -1 -2 -3 -4
这篇关于Sobel滤芯大尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!