Skip to content

Add OpenCV template matching to vision library #259

@madfrog54321

Description

@madfrog54321

Using OpenCV template matching the vision library will perform template matching on a streaming source (i.e. video file, webcam).

Requirements

  • A class with the following public interface is created:
class TemplateMatchingDetector {
public:
  TemplateMatchingDetector(cv::VideoCapture imageStream, cv::Mat templateImage, float sensitivity);
  std::tuple<bool, float, float> update();
}
  • TemplateMatchingDetector(...) creates a TemplateMatchingDetector object given a cv::VideoCapture (i.e. video file, webcam), a cv::Mat (i.e. image), and a sensitivity (i.e. needed match strength from the template matching algorithm to return a positive match).

  • update() reads a cv::Mat using the >> operator on the cv::VideoCapture object, and then performs OpenCV template matching on the frame. The returned tuple<bool, float, float> is of structure tuple<[is the template image found?], [the x coordinate of the template image from -1 to 1], [the y coordinate of the template image from -1 to 1]>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions