Home

Awesome

Marker Tracking Algorithm

Requirement

pip3 install pybind11 numpy opencv-python

Example

make
python3 src/tracking.py

Shear force test

Twist force test

Configuration

Configuration based on different marker settings (marker number/color/size/interval)

Step 1: Marker detection

The marker detection is in src/marker_detection.py

Modify the code based on the marker color & size.

To verify, run

python src/tracking.py calibrate

And the mask should looks like:

Set Parameters:

Step 2: Marker matching

Set Parameters

src/setting.py

Output

The Matching Class has a function get_flow. It return the flow information:

flow = m.get_flow()

output: (Ox, Oy, Cx, Cy, Occupied) = flow
    Ox, Oy: N*M matrix, the x and y coordinate of each marker at frame 0
    Cx, Cy: N*M matrix, the x and y coordinate of each marker at current frame
    Occupied: N*M matrix, the index of the marker at each position, -1 means inferred. 
        e.g. Occupied[i][j] = k, meaning the marker mc[k] lies in row i, column j.