opencvcomputer-visionobject-detectiontemplate-matching

Arrow recognition in video


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.


Solution

  • 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