Git Product home page Git Product logo

magic-projection's Introduction

Trick 1: Dis/appearing Coins

The simplest trick is to wave your hands over the field and make coins magically appear and/or disappear. Implement a program that tracks the hands of the magician and devise some way in which the user can add or remove coins. For example, by spreading their hands to signal a change.

Use Torchvision pre-trained model for coin detection, and use Mediapipe library for hand detection. The orientation of the thumb is defined by the difference between the thumb position and the wrist position in the viewport.

If there has coin and hand is detected,

  • thumb point to the right, coins disappear
  • thumb point to the left, coins appear

Quick Start

python coin.py

References

Faster R-CNN model with a ResNet-50-FPN
Hand landmarks detection guide

Trick 2: Changing Cards

A more advanced trick tracks white playing cards and replaces the view of the white card with a color change or by replacing the card. In this case, your program must track the card and then replace the white card with the image of a card that is suitably adapted to match the environment.

Use the HoughLines function of the OpenCV library to detect seperating line. Convert the image to HSV color space and customize the upper/lower bounds of the region to filter out the specified color. In this piece, if the object is to the left of the seperating line, the color will change from blue to red; otherwise, the color will not change.

Quick Start

python card.py

References

Hough Line Transform
Changing Colorspaces

Trick 3: Tracking Dice (Incomplete)

In this trick, the user predicts the number that will appear on a single or multiple dice. Another trick is for the user to throw a dice. In this case, the system must project three sides viewable from a dice.

Use D6 Dice - Images dataset which has many dice images. The code can track the position of each dices from a top-down view images, the bounding of each dice are mark with green line and corners mark with red dot. A function can print out all combinations for a target_sum using numbers of dices.

  • Detect dices position
  • Get dices corner's coordinate
  • Generate target_sum combinations
  • Project new number on the dices
  • Real-Time capability

Quick Start

python dice.py <target_sum>

(e.g.)
python dice.py 10

References

D6 Dice - Images

magic-projection's People

Contributors

nick8592 avatar

Watchers

 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.