This is the demo code of the paper (under review), "HydraMarker: Effificient, Flexible, and Multifold Marker Field Generation"
An 
You cannot find two identical 3

Why we need marker field? One of the reasons is for position-sensing marker. Imagine a remote control vehicle sliding on the marker, and locating itself by a bottom view camera, which has a very limited field-of-view, as shown below. The vehicle can still estimate its position on this marker, because the sub-region it observes is unique.

A commercial example is the camera-based digital pen. The pen captures and converts handwritten analog information into digital data. It locates itself on a digital paper based on a bottom view camera. The camera observes the dot array on the paper, but only a small sub-region (typically 6

However, generating marker field is not easy. The most practical method was proposed by Szentandrasi et al.
I. Szentandrasi, M. Zacharias, J. Havel, A. Herout, M. Dubska, and R. Kajan, “Uniform marker fifields: Camera localization by
orientable de bruijn tori,” in Proc. IEEE International Symposium on Mixed and Augmented Reality. IEEE, 2012, pp. 319–320.
You can download some ready-made marker fields from their project page, http://www.fit.vutbr.cz/research/groups/graph/MF/. However, if you want to customize your marker fields, do something more than its original definition, but do not have a supercomputer, and do not know how to modify their genetic algorithm, this HydraMarker toolkit is your best choice (at least for now).
There are two versions of HydraMarker.
The C++ & OpenCV version is super fast. It can finish a 10
There is an example.cpp/example.m in C++ & OpenCV / Matlab version. It will teach you how to define marker field and tag shapes. The relevant functions are also richly commented.
Note that, you can highly customize your marker field by presetting some values. There are four states, 0, 1,
For example, if you want a 30
Your camera scope can cover a sub-region about 4
Then, feed the initial marker field and tag shapes to the toolkit, and start the generation process. You might get a marker field like this.
More examples below. From left to right:
- A 90 × 90 marker field with 4 × 4 tag shape and three empty corners. These corners can be filled by other functional patterns, such as QR locators.
- A 123 × 123 marker field with 5 × 5 tag shape. An array of locators are inserted. Different from the QR locators, these insertions are part of the marker field, as red and green correspond to 0 and 1 respectively.
- An 85 × 85 frame-shape marker field. The tag shapes
are 4 × 4, 3 × 6, 2 × 9, and 1 × 20.

How to draw a position-sensing marker based on marker fields? And how to read ID tags from the position-sensing marker? It depends on your application, and there is no standard answer. Actually, this is the world we would like to open for you with this toolkit. It is your responsibility from now on.
However, if you have no idea yet, let us give you another short ride.
There is an example. We draw a chessboard, and put dots guided by a marker field, as shown below.

Then, we print this marker on a paper, attach it on a tool for tracking, and read the marker based on the demo code "Example of Reading Algorithm".
The reading process has 3 steps: detect, construct, recognize.
The "detect" step detects cross points in an image (the 1st figure below); The "construct" step organizes the detected cross points into grids to recover the background chessboard (the 2nd figure below); The "recognize" step checks whether each chessboard square has a dot, and compare the results with the marker field to determine the index of each organized cross point (the 3rd figure below). Now, every cross point on this curved surface has been identified. We can do the tracking by PnP and BA based on the model of this tool.

This is a rough example. We believe you will have better ideas of utilizing marker fields. Feel free to use this toolkit! If convenient, please cite our paper (it is not ready yet) or this address.


