Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Augmented Reality Marker Image Overlay

Description

This project demonstrates a fundamental Augmented Reality (AR) application built using Python and OpenCV. It enables you to overlay an image onto a reference marker detected in a video stream.

Functionality

  1. Marker Detection: The project uses the ORB algorithm to detect key features from the reference marker ('./assets/ref.png). Similarly, the feaures from each frame of the video are detected for identifying the marker in the video.

  2. Marker Localization: Brute force matching is used to find the matches between the detected features from both the images (marker as well as the video frame). Further, out of all the matches found, only a few matches are retained to neglect matches with lower distances.

  3. Homography Calculation and Perspective Wrapping: Once sufficient number of matches are found, the homography matrix is calculated to estimate the rotation, translation, and scaling of the marker in the video. Further, the overlay image is then wraped according to the calculated homography.

  4. Overlaying the image over the marker: the overlay image is overlayed onto the marker in the video frame with proper masking.

Demo:

demo.mp4

Usage:

  • Clone/Download the repository to your device
  • change to the directory 'augmented-reality-marker-overlay'
cd augmented-reality-marker-overlay 
  • It is recommended to setup a virtual environment (however, not necessary).
  • Install the dependencies from the requirements.txt file.
pip install -r requirements.txt
  • Take out a small printout of the marker image ('./assets/ref.jpg'), or replace the marker image with your marker.
  • Run the app.py file
python app.py

About

This repo features a simple AR application using OpenCV to overlay an image over a reference card in a video feed

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages