OpenCV 2.4.8 (Python) Determining Orientation of an Arrow

前端 未结 1 1210
死守一世寂寞
死守一世寂寞 2020-12-10 08:20

I am currently working on a project where I need to determine the orientation of arrows. These arrows will be used as input for a robot to determine what direction it should

相关标签:
1条回答
  • 2020-12-10 09:09

    Here is some approach, I think it will works with the image you provided.

    As your arrow image have the following angle for each corner as shown in the below image, you can always consider arrow tip as the corner which have angle close to 90 degree, as well as adjacent corner with angle close to 45 degree.

    That is find out the arrow tip, calculate angle for adjacent line which making the arrow pointer, and add up the angle, which will be your arrow direction.

    enter image description here

    So try with

    1. Find contour and approxPolyDP.

    2. Find angle for each line as well as the corner(angle between adjacent line).

    3. Search for the tip of arrow using above criteria for corner.

    4. Now you got the arrow pointer and adjacent line(with angle), take the resultant of these two lines as your direction, that is just add up the angle.

    Also see this link might be helpful.

    0 讨论(0)
提交回复
热议问题