Home - UCI-EECS113-Spring17/Counting-Cards GitHub Wiki

Welcome to the Counting-Cards wiki!

Overview

  • The main purpose of this device is to monitor a game of blackjack and detect potential card counters who might erase or negate any potential profits for the casino hosting the game. Our device carries out this process by using a webcam and object recognition algorithms to detect individual chips and cards on the playing table. Once this data is captured, onboard algorithms calculate the correlation between the player’s bets and the remaining cards in the deck to calculate the likelihood that the player is counting cards with the intent of removing or reversing the house’s advantage in the game.

Required Peripherals

  • The only peripheral required for this project (other than all of the onboard switches, buttons, and LEDs) is a USB webcam. This is used to collect data, such as bet sizes and cards played, from the game being monitored below.

Project Features

  • Easy to comprehend real-time LED feedback on deck “heat” and probabilistic likelihood that the player is counting cards, with adjustable threshold for detection.

  • Support for any number of decks (current configuration allows 1, 2, 6, or 8 decks to ensure compatibility with most Las Vegas blackjack tables, but other values can easily be programmed) with real-time LED feedback on how many decks are currently in play.

  • Dedicated buttons for shuffling, new player, resetting, and exiting the session.

  • Robust error handling with LED feedback for various issues. Most common errors only require a deck shuffle or a session restart, with very few resulting in outright termination of the program.

Responsibilities & Contributions

The labor this project is split into three modular components:

  • Image Processing: Syed Omer Azeemuddin & Rudy Aquino

  • Object Recognition: Cheng Zhu

  • Data Processing & Feedback: Brandt Bucher

Image Processing

  • This stage of the project is tasked with setting up the webcam and using openCV to process the images. The webcam must be able to effectively capture the cards being dealt and chips being spent in real time, and at a sufficiently high resolution.

Object Recognition

  • The object recognition algorithms in use must be capable of actually making the cards and chips recognizable to the system. This is done by creating a Haar cascade classifier using OpenCV, which should determine the cards and chips in play and forward the information to the onboard algorithm.

Data Processing & Feedback

  • The bulk of our code is devoted to quickly and efficiently processing the incoming data to determine what cards remain in the deck, and correlating this information with the player’s betting history. If the player has a history of betting more when higher-valued cards remain in the deck (and vice-versa), it is extremely likely that the player is secretly counting cards. Direct user inputs and outputs are handled through all of the onboard buttons, switches, and LEDs.

Progress

  • Currently, the counting algorithm is working as intended with both controlled test data and random noise, and consistently produces the expected output for each. The USB webcam in use is having difficulty capturing images at an acceptably high frame rate, so additional work is going towards faster, more efficient imaging. Similarly, the object recognition program is experiencing issues performing with the adequate speed and accuracy required to process images in real-time. The team is currently in the process of training additional, more accurate classifiers in order to make this stage of the process more efficient, as it is the primary bottleneck at this time. A mounting apparatus will also need to built.

Plan

  • Week 6: Recognize cards and chips with less than 10% error rate.

  • Week 7: Build mounting apparatus and have whole system (imaging, detection, and processing) working together.

  • Week 8: Fine-tune system to reduce errors, and make processes more efficient with respect to time and memory.

  • Weeks 9 & 10: If time allows, implement additional features.

    • Recognize overlapping cards.
    • Detect different denominations of chip ($1, $5, $25, $100, etc...).
    • Use a second, table-level camera to support stacks of chips.