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:
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.
So try with
Find contour and approxPolyDP.
Find angle for each line as well as the corner(angle between adjacent line).
Search for the tip of arrow using above criteria for corner.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With