Uno Card Recognition – uno_card_cv
This repository contains Jupyter Notebook files for recognizing Uno cards.
Video demonstrations can be found on these links: Part1: https://youtu.be/nRWiw0EtqKo
Part2: https://youtu.be/k9-xhOXJ6SE
The repository contains the following Notebooks:
- hsv_limits_app: For isolating a color in an image and getting the lower and upper HSV limits of the color for better identification.
- Uno_card: The main program for Uno card recognition.
The program performs three main functions:
- Creating a dataset from images
- Training a random forest classifier
- Uno card recognition in an image or folder or on camera
Requirements
To use the uno_cv repository, you need to install OpenCV-Python (cv2) for image processing and computer vision tasks. Other libraries/modules used are:
- os: to iterate through the images in a folder
- numpy: to deal with large arrays
- pickle: to save and load the trained machine learning model
- sklearn: the main library used for building the machine learning model
- tkinter: used to open the file and folder directory
- glob: provides a way to generate lists of files that match a specified pattern
- pandas: provides fast, flexible, and expressive data structures designed to work with relational or labeled data both easily and intuitively
- matplotlib: a plotting library for the Python programming language
- sklearn: a machine learning library for Python, which provides tools for classification and regression
- IPython.display: provides a way to display rich media such as HTML, Markdown, images, and videos in the Jupyter Notebook.
Usage
To use this repository:
- Download or clone the repository.
- Run all the cells in the Uno_card.ipynb notebook.
- Follow the prompts in the output cell.
References:
https://pyimagesearch.com/2021/01/19/opencv-bitwise-and-or-xor-and-not/
https://github.com/CiprianFlorin-Ifrim/uno_recognition_computervision
https://datacamp.com/tutorial/random-forests-classifier-python
https://stackoverflow.com/questions/10592605/save-classifier-to-disk-in-scikit-learn