Marker detection

A marker is usually designed as a rectangle image holding black and white areas inside it. Due to known limitations, the marker detection procedure is a simple one. First of all we need to find closed contours on the input image and unwarp the image inside it to a rectangle and then check this against our marker model.

In this sample the 5 x 5 marker will be used. Here is what it looks like:

Marker detection

In the sample project that you will find in this book, the marker detection routine is encapsulated in the MarkerDetector class:

/** * A top-level class that encapsulate marker detector algorithm */ class MarkerDetector { public: /** * Initialize ...

Get Mastering OpenCV with Practical Computer Vision Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.