Giter Site home page Giter Site logo

anubhavparas / ar-tag-detection Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 222.02 MB

The project focuses on detecting custom AR tags that are used for obtaining a point of reference in the real world, such as in augmented reality applications.

Python 100.00%
computer-vision homography warping contour-detection opencv image-warping homography-matrix

ar-tag-detection's Introduction

AR Tags detection and processing

The problem focuses on detecting a custom AR tag (see fig.), that is used for obtaining a point of reference in the real world, such as in augmented reality applications.

AR Tag

alt text

The code basically involves three tasks:

1) Detection of the AR tags in the videos (position and orientation) and calculating the id corresponding to each tag in the videos.
2) Tracking the AR tags throughout the video.
3) Superimposing 'lena' image and drawing a 3D cube over the tags in the videos. 

Steps to identify the id, track the tags and superimposing lena image and cube over the tags can be found in the report.

Output

The solution involves implementation of cv2.getPerspectiveTransform() and cv2.warpPerspective() functions of OpenCV.

Warped Tags

alt text

Tag and ID detection in video frames:

alt text

alt text

alt text

Superimposing Lena image on the tags with proper orientation:

alt text

alt text

Drawing 3D cube over the tags:

alt text

alt text

Output videos can be found here

Instructions to run the code:

python file named ‘process_ar_tags.py’ (location: /Code/) is to be run for the execution of the code:

Please make sure that the following files and sub-directories are at the same level relative to ‘process_ar_tags.py’ :

  • /process_ar_tags.py

  • /media/multipleTags.mp4

  • /media/Tag0.mp4

  • /media/Tag1.mp4

  • /media/Tag2.mp4

  • /media/Lena.png

  • The code process the video frames and 1) detects the tag_id, 2) superimposes Lena image on the tags, 3) draws a 3D cube over the tags

  • Commands to run the code:

  • To display the detected tag and their ids - $ python process_ar_tags.py

  • To display Lena image - $ python process_ar_tags.py --show_lena=True

  • To display cube - $ python process_ar_tags.py --show_cube=True

  • To display lena image and cube - $ python process_ar_tags.py --show_lena=True --show_cube=True

  • Lena image frame and cube display frame will open in a separate window

  • The code by default process multipleTags.mp4 video. To process a different video other than this, say Tag0.mp4: $ python process_ar_tags.py --video_option=Tag0

  • Any logical permutations of arguments can be used to test different behaviors

ar-tag-detection's People

Watchers

 avatar  avatar

Forkers

knut0815

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.