Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV 2.4.8 (Python) Determining Orientation of an Arrow

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 travel in.

I am using a Beaglebone Black with Ubuntu and OpenCV 2.4.8. I've experimenting with SURF, ORB, SIFT, Moments, and BFMatcher. I haven't found a reliable way to determine the orientation of an arrow. This needs to be done in real time as we will be using frames from a video.

I was wondering if someone could offer a reliable solution to determine the orientation of an arrow?

Here is a sample image:

like image 845
Knoose Avatar asked Apr 05 '14 03:04

Knoose


1 Answers

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.

like image 123
Haris Avatar answered Oct 26 '22 23:10

Haris