Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect 45 degree edges in an image

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

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

like image 926
zebra Avatar asked Dec 17 '11 18:12

zebra


People also ask

How do we detect edges in an image?

Edge detection is an image processing technique for finding the boundaries of objects within images. It works by detecting discontinuities in brightness. Edge detection is used for image segmentation and data extraction in areas such as image processing, computer vision, and machine vision.

Which operator is used to detect edges in an image?

Laplacian Operator: Laplacian Operator is also a derivative operator which is used to find edges in an image. The major difference between Laplacian and other operators like Prewitt, Sobel, Robinson and Kirsch is that these all are first order derivative masks but Laplacian is a second order derivative mask.

Which filters are used for edge detection in an image?

The Canny filter is a multi-stage edge detector. It uses a filter based on the derivative of a Gaussian in order to compute the intensity of the gradients. The Gaussian reduces the effect of noise present in the image.


1 Answers

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

Details

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}

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.

Taking an example. Following picture

enter image description here

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

enter image description here

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

enter image description here

like image 180
halirutan Avatar answered Sep 24 '22 14:09

halirutan