Code Monkey home page Code Monkey logo

augmented-sword's Introduction

RVA Project 1 - Augmented Sword

The main objective of this project is to develop an application that augments an image of a person wielding a reference marker by rendering a virtual sword associated with the marker. The marker may be a planar piece of wood or hard cardboard with two patterns, one on each face of the planar object. Alternatively, you may develop an improved version of the application, using a cube with patterns on five of its faces (on all faces except the one that is facing the user’s hand).

Planar Marker Virtual Sword Planar Marker
Cube Marker Virtual Sword Planar Marker

Installation and prerequisites

  • Install Python3, see official website
  • It is recommended to run in a conda environment, our advice is to use Miniconda
  • To setup the project, you need the following packages:
    • opencv-python
    • numpy
    • opencv-contrib-python

Conda environment setup

  1. After installing Miniconda, create a conda environment:
conda create -n augmented_sword python=3.11
  1. Activate the environment:
conda activate augmented_sword
  1. Install the necessary libraries:
pip install -r ../requirements.txt

Usage

How to run

  1. Make sure the augmented_sword environment is activated and you're under the src/ directory:

    conda activate augmented_sword
    
    cd src/
  2. Windows: Using the Command Line, inside the project directory:

    python main.py

    Linux/MacOS: Using the Command Line, inside the project directory:

    python3 main.py 
  3. The program will wait for q to be pressed, to close the window and exit.

How to remove

  1. Remove the created environment:
conda remove -n ENV_NAME --all
  1. Delete the local repository.

Virtual Sword Display Modes

After running the program, the device's default webcam will be used to capture the image. The image will be processed and the result will be displayed in a new window. The user can then display a virtual sword using one of two methods:

Note: In this project we use ArUcO markers that can be found here.

Simple Mode - Flat Cardboard Cutout (2 ArUcO Markers)

  • A flat card with a handle located at the bottom. It features two printed markers with the IDs 0 and 1, namely Marker_0 and Marker_1.
  • The one we used is 15cm x 15cm, and looks like the following:

image

Advanced Mode - Handheld Cube (5 ArUco Markers)

  • A cube with 5 faces, where the markers from 1 to 4 are placed on the side faces without any rotation and the marker 0 is placed on the top face, like in the following picture:

image

License

This project is licensed under the Apache License, Version 2.0.

For the complete text of the Apache License, please refer to the Apache License.

augmented-sword's People

Contributors

fabiomiguel2000 avatar luismrguimaraes avatar ricas00 avatar

Watchers

 avatar  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.