如何检测图像中的45度边缘 [英] How to detect 45 degree edges in an image

查看:339
本文介绍了如何检测图像中的45度边缘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果不是只获得所有边缘,我只希望形成45度角的边缘。有什么方法可以检测到这些?

If instead of getting all edges, I only want edges that make 45 degree angles. What is a method to detect these?

是否可以检测所有边缘,然后以某种方式运行约束霍夫变换来检测哪些边缘形成45度?

Would it be possible to detect all edges, then somehow run a constrained hough transform to detect which edges form 45 degrees?

推荐答案

使用对角线结构元素并仅对图像进行卷积有什么问题?

What is wrong with using an diagonal structure element and simply convolve the image??

请在此处进行阅读,并且应该清楚如何构建结构元素。如果您熟悉卷积,则可以构建一个简单的结构矩阵,无需理论即可放大对角线

Please read here and it should become clear how to build the structuring element. If you are familiar with convolution than you can build a simple structure matrix which amplifies diagonals without theory

{ 0,  1,  2}, 
{-1,  0,  1}, 
{-2, -1,  0}

这个想法是:您想放大图像中的像素,其下方45度与上方45度有所不同。在45度边缘时就是这种情况。

The idea is: You want to amplify pixel in the image, where 45deg below it is something different than 45deg above it. Thats the case when you are at a 45deg edge.

举个例子。后续图片

由上述矩阵卷积得到一个灰度图像,其中最高像素值具有恰好为45deg的线。

convolved by the above matrix gives a graylevel image where the highest pixel values have those lines which are exactly 45deg.

现在的方法是简单地对图像进行二值化。等等

Now the approach is to simply binarize the image. Et voila

这篇关于如何检测图像中的45度边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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