Git Product home page Git Product logo

tracking's Introduction

Marker Tracking Algorithm

Requirement

  • opencv
  • pybind11
  • numpy
pip3 install pybind11 numpy opencv-python

Example

make
python3 src/tracking.py

Shear force test

  • Pink arrow: the marker is out of boundary/not detected, but can be inferred from surrounding flow (assume same first derivative)

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:

  • src/marker_detection/find_marker: The kernel size in GaussianBlur, it depends on marker size. should could cover the whole marker.
  • src/marker_detection/find_marker: change yellowMin, yellowMax based on markers' color in HSV space.
  • src/marker_detection/marker_center: change the areaThresh1, areaThresh2 for the minimal and maximal size of markers

Step 2: Marker matching

Set Parameters

src/setting.py

  • RESCALE: scale down
  • N, M: the row and column of the marker array
  • x0, y0: the coordinate of upper-left marker (in original size)
  • dx, dy: the horizontal and vertical interval between adjacent markers (in original size)
  • fps_: the desired frame per second, the algorithm will find the optimal solution in 1/fps seconds

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.

tracking's People

Contributors

wx405557858 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.