2

I would like to create a program that can identify arrows in a video feed and determine the direction they are pointing at (left or right). My aim is to use this program with an arduino robot in order to determine the direction in which the bot should move.

my problem is which method to use. I ve narrowed my options down to template matching or SURF. template matching is good because it is rotation independent, therefore it can determine between left and right arrows. However since the bot will be moving, the size of the template arrow might not be equal to that of the video feed, resulting in no matches.

SURF solves this problem however it is rotation invariant. This means that Left arrows and right arrows will be considered as the same thing.

Can anyone please suggest an approach I can use for this program.

Thanks in advance for any help

P.S I will be using OpenCV for implementation.

Jeremy Borg
  • 413
  • 2
  • 6
  • 16
  • 1
    lol, yea. dilemma. template matching comes with alot of other flaws, like being sensitive to projection/scale/shearing(your robot mounted cam will come with all of the 3), so you can safely discard that already. a findContours/matchshapes approach then, maybe ? – berak May 27 '14 at 21:18
  • 1
    See the answer [here](http://stackoverflow.com/questions/22876351/opencv-2-4-8-python-determining-orientation-of-an-arrow/22876975#22876975). – Haris May 28 '14 at 03:49
  • Thank you for your comments. I am using the contour approach that you suggested. Although I haven't managed to get any good results yet, I am much closer to solving the problem. So far I ve managed to filter out the extra ovjects in the image and keep the arrows only. I am now trying to perform the angle extraction as you suggested. thanks again – Jeremy Borg May 28 '14 at 21:40

1 Answers1

2

I managed to solve the problem by using canny edge detection and HoughLinesP. The system works pretty well but has a limited rotation range at which it will detect the direction correctly (approx 15 degrees).

basically I first performed colour detection to detect the arrow, then used houghlinesp to find its outline. Out of these lines, I eliminated all those which are horizontal or vertical, leaving just the ones at the tip as shown in red. I then used the end points of each line to determine the direction.

enter image description here

Jeremy Borg
  • 413
  • 2
  • 6
  • 16