This Blackjack Card Counter, built with Python and utilizing the OpenCV library, allows you to analyze card dealing videos or live video captures. The code can identify any card in view, keep track of the player and dealer hand totals, and provide a running count for card counting.
-
Card Identification: Uses OpenCV for precise card detection and recognition in both videos and live captures.
-
Hand Totals: Keeps track of the player and dealer hand totals for Blackjack.
-
Running Count: Implements card counting with a real-time running count feature.
-
Flexible Input: Supports both video files and live video captures for versatile use.
-
Requirements:
- Ensure Python is installed.
-
Install Pygame:
-
Install the required OpenCV library:
pip install opencv-python
-
-
Run the Script:
-
Run the script with:
python main.py
-
By default, the script processes a video file. However, you can customize the input to either use a different video file or enable live video capture.
-
Change Video File:
-
Open
main.py
in a text editor. -
Locate the
video_path
variable and update it with the path to your desired video file.video_path = 'path/to/your/video/file.mp4'
-
-
Use Live Video Capture:
-
Open
main.py
in a text editor. -
Set
video_path
to0
to enable live video capture.video_path = 0 # for live video capture
-
Clone the repository:
git clone https://github.com/mivan50/OpenCV-Blackjack-Counter.git
This project is licensed under the MIT License - see the LICENSE.md file for details.