Computer Science Projects

Playing Card Recognition Algorithm

This program reads a typical playing card and can recognize its number and suit.

This was a project that was inspired by a good game of Egyptian Rap Slap during a lunch break. Instead of identifying the value of a set of coins, I decided to try to identify the value and suit of the playing cards that we were using.

Initially, I thought to read the number directly from the face of the card. Yet, after processing the image, the detail was too fine for the computer to accurately pick up the number itself. So, instead, I find the value of the card by counting the number of shapes (diamonds, spades, etc) from the face of the card.

Then came the real challenge. That was figuring out the suit of the card. I came to the conclusion that I would classify the suit by finding the area of each unique suit's shape. Much like reading the number on the card, the filters were not accurate enough to find the exact contours around the shapes. This was due to the blur factor that was used to eliminate noise, which made the contours fuzzy and less accurate. So using a bilateral filter function, I was able to blur, while at the same time preserving edges.

Letter Recognition With machine learning

Using KNN machine learning and a classification model the computer learns what the letters 'H', 'S', and 'U' look like, and is able to identify new letters using collected data. There were three steps to this project.

  • First was pre-processing, to go from the raw video input (left side of image) to just the straightened, isolated letter, without color (right side of image). 

  • Next was data collection, where the algorithm learns what an "ideal" 'H', 'S', and 'U' would look like. This is done by storing all the pixel intensities of the different letters on a 20x20 array. 

  • The new, undefined letter's pixel intensities would be compared to the intensities of the other characters. The character with the most similar intensities is the predicted character.

Previous
Previous

Research

Next
Next

Robotics