Skip to content
Advertisement

Hough Transform for equilateral triangles detection

I have a homework where I have to implement hough transform for equilateral triangles detection:

  • The trianlges edges are of length L, so this means all the trianlges in the image are the same. What did I do? first i used canny edge detector to get the edges in the image. now i have to find a way to parameterize for the hough transform, my idea is to have these parameters:
  • The center of the triangle.
  • The rotation angle theta. 3 trianlges with the same center I started to implement the following idea but I’m thinking it’s a bit harder than i thought it is because: I have to check for each edge point which triangle center it is a part of, and for that i don’t think there is a way to find it.

so can anyone help by telling my if my idea is right or wrong?

if it’s good parameterization how can i proceed from this point?

if not what is a good parameterization?

This is my first question here so I hope it’s not as bad as I think it is. Thank you, and have a nice day.

edit

added a sample of an input image with triangles example of input image

Advertisement

Answer

I think that this is a good parametrization, i used the same one. Note that for each point you have its gradient, which means that you have its triangle angle which it may belong. Note about equaliteral triangle angle, this kind of triangle has 3 edges which are +120 degrees each, for example: edge1: 1 edge2: 121 = 1 + 120 edge3: 241 = 1 + 120 + 120 which means that each edge gradient modulus 120 will yield the same result. Which means that given a point with its gradient (assume the gradient directed inside the triangle) you can easily calculate the angle of the triangle it might belong, this way you only have to iterate over the x,y in the hough transform. I used these equations: https://byjus.com/jee/centre-of-mass-of-equilateral-triangle/#:~:text=In%20geometry%2C%20the%20equilateral%20triangle,the%20three%20sides%20are%20equal.&text=In%20an%20equilateral%20triangle%2C%20the,at%20which%20its%20medians%20meet.

Advertisement