大尺寸 Sobel 滤波器核 [英] Sobel filter kernel of large size

查看:17
本文介绍了大尺寸 Sobel 滤波器核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用大小为 3x3 的 sobel 滤波器来计算图像导数.看网上的一些文章,尺寸 5x5 和 7x7 的 sobel 过滤器的内核似乎也很常见,但我找不到它们的内核值.

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.

提前致谢.

推荐答案

2018 年 4 月 23 日更新:似乎下面链接中定义的内核不是真正的 Sobel 内核(适用于 5x5 及更高版本)-它们边缘检测可能会做一个合理的工作,但它们不应该被称为 Sobel 核.请参阅 Daniel 的回答 以获得更准确和全面的总结.(我将把这个答案留在这里,因为 (a) 它是从各个地方链接到的,并且 (b) 接受的答案不容易被删除.)

UPDATE 23-Apr-2018: it seems that the kernels defined in the link below are not true Sobel kernels (for 5x5 and above) - they may do a reasonable job of edge detection, but they should not be called Sobel kernels. See Daniel’s answer for a more accurate and comprehensive summary. (I will leave this answer here as (a) it is linked to from various places and (b) accepted answers can not easily be deleted.)

Google 似乎提供了很多结果,例如http://rsbweb.nih.gov/nih-image/download/user-macros/slowsobel.macro 建议 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 滤波器核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆