Coder Social home page Coder Social logo

stag's Introduction

STag - A Stable, Occlusion-Resistant Fiducial Marker System

This repository is an improved and updated fork of the stable fiducial marker system, using OpenCV 4.

Note

For the corresponding Python package, refer to: https://github.com/ManfredStoiber/stag-python.

๐Ÿ“Š Comparison Between Different Marker Systems:

๐Ÿ“– Usage

// load image
cv::Mat image = cv::imread("example.jpg");

// set HD library
int libraryHD = 21;

auto corners = std::vector<std::vector<cv::Point2f>>();
auto ids = std::vector<int>();
auto rejectedImgPoints = std::vector<std::vector<cv::Point2f>>(); // optional, helpful for debugging

// detect markers
stag::detectMarkers(image, libraryHD, corners, ids, rejectedImgPoints);

// draw and save results
stag::drawDetectedMarkers(image, corners, ids);
cv::imwrite("example_result.jpg", image);

For an explanation of libraryHD = 21 refer to Configuration

๐Ÿท Markers

๐Ÿ“‹ Getting Started

  1. Install Prerequisites

    CMake >= 3.16

    • On Linux: apt install cmake

    OpenCV 4 for C++

    • On Linux: apt install libopencv-dev
  2. Clone this repository

    • git clone https://github.com/ManfredStoiber/stag
  3. Build the project.

    In the project directory, run the following commands:

    1. mkdir build
    2. cd build
    3. cmake ..
    4. cmake --build .
  4. Run the example

    • On Linux: Run ./stag_example
    • On Windows: Run stag_example.exe

    This example application detects the markers in ../example.jpg and saves the visualized results to example_result.jpg

Note

The library is created as static by default. If you want to create a shared library instead, use the cmake option BUILD_SHARED_LIBS=ON.

๐Ÿ›  Configuration

When initializing the library, following parameters can be specified:

  • libraryHD:

    • Sets the "family" or "type" of used STag markers

      • Each library has a different amount of markers
      • Only the markers of the chosen library will be detected
    • The following HD libraries are possible:

      HD 11 13 15 17 19 21 23
      Library Size 22,309 2,884 766 157 38 12 6
    • Specifies the used Hamming Distance, for further information refer to the original paper

  • errorCorrection:

    • Sets the amount of error correction
    • Has to be in range 0 <= errorCorrection <= (libraryHD-1)/2
    • For further information refer to the original paper

๐Ÿ“ฐ Originally Published in the Following Paper:

B. Benligiray; C. Topal; C. Akinlar, "STag: A Stable Fiducial Marker System," Image and Vision Computing, 2019.

stag's People

Contributors

bbenligiray avatar manfredstoiber avatar powei-lin 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.