Opencv Sobel边缘检测对角线(右上45deg,左上135deg)
我对opencv的Sobel边缘检测器有疑问。从它的文档来看,它似乎只适用于水平和垂直方向的边缘(通过指定0,1或1,0)。 有谁知道如何使用 cvSobel 获得对角边缘 45 度和 135 度(不是 Canny 方法)。 Matlab 有一个灵魂及其边缘(I,'sobel'...) 选项,但我的代码都是用 C++ 编写的,我想保留它。
感谢您的建议和解决方案。
I am having issue with opencv's Sobel edge detector. From its documentation it seems to work only for horizontal and vertical direction edges (by specifying 0,1 or 1,0). Has anyone got idea how to get the diagonal edges 45deg and 135deg with cvSobel (not Canny methods).
Matlab has a soultion with its edge(I,'sobel' ...) option, but my code is all in c++ and I would like to keep it as such.
Thanks for suggestions and solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿。
您通常可以按以下方式计算任何方向上的任何滤波器:
这适用于边缘检测、运动模糊和任何线性定向滤波器。
Hei.
You can generally calculate any filter in any direction in the following way:
This works for edge detection, motion blur and any linear directed filter.
它确实检测对角线。你只需运行两次。根据定义,既水平又垂直的点是对角线。
It does detect diagonals. You just run it twice. A point that is both horizontal and vertical is, by definition, diagonal.