Giter Club home page Giter Club logo

blackjack-tracker's Introduction

Blackjack Tracker

Blackjack game tracker using OpenCV and Python

Download

Clone the repository:

git clone https://github.com/martinabeleda/Blackjack-Tracker

or download zip:

https://github.com/martinabeleda/Blackjack-Tracker/archive/master.zip

Usage instruction

Create a symbolic link to OpenCV on your machine

Note 1 : Skip this section if you've already created this symbolic link

Note 2: You need to have OpenCV compiled on your machine for python 3. If you haven't, I would recommend this link: https://www.learnopencv.com/install-opencv3-on-ubuntu/

Navigate to the top directory of the project:

cd Blackjack-Tracker

Find the location of OpenCV python binary (cv2.so) on your machine

find /usr/local/lib/ -type f -name "cv2*.so"

You should see something like the following (copy this path).

/usr/local/lib/python3.5/dist-packages/cv2.cpython-35m-x86_64-linux-gnu.so

Forcefully remove all symbolic link to OpenCV in the current directory to avoid conflict. They are likely linked from other (my) machine. If rm indicates no such file present, just move on.

rm -f cv2*.so

Create a symbolic link to OpenCV on your local machine

ln -s "the file path copied above"

Run

Plug in the external webcam, wait for about 30 seconds for the device to be recognized.

Navigate to the top directory of the project:

cd Blackjack-Tracker

Work on the virtual environment included in this folder.

To activate:

source blackjack_env/bin/activate

You should now see (blackjack_env) at the front of your command line.

Run the program with optional argument to indicate which camera to use (default: 0). Index 0 is usually the webcam on your laptop, and index 1 is an external webcam.

python3 main.py
python3 main.py -camera 1

To deactivate:

deactivate

About the program:

  • This program only works on Python 3
  • OpenCV version 3.0 and above is recommended.
  • This program only works in the virtal environment included. Alternatively, if you wish to run them in your local virtual environment, you can install the requirements included:
pip3 install -r requirements.txt
  • Program starts in the calibration stage with 100 seconds countdown
  • Press 'a' if you're happy with the transformation found
  • Program enters card recognition state.
  • Press 't' to toggle between gesture state and card recognition state.
  • Press 'c' to recalibrate and 'a' to accept the calibration
  • Press 'q' to quit the program

Live demo

IMAGE ALT TEXT HERE

Software Modules

  • Playing surface detection and transformation
  • Card recognition
  • Coin detection
  • Gesture Recognition

blackjack-tracker's People

Contributors

czyapp avatar jpwebb avatar martinabeleda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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