Color Detection
This is the color detection process for the card to determine what kind of card it is.
How does it work?
Before anything, A 'mask' is applied to the image to cover the picture in the middle
The image is then converted from RGB to HSV (Hue, Saturation, Value)
These can be seen below
We define color boundaries for the color we want to detect in HSV notation
These Boundaries are then used to create a mask
This mask is dilated to bring out the color.
This is done by performing convolution (with the current image) with a 5x5 matrix of 1s
The result is then bitwise ANDED with the HSV image to extract only the desired colors
Count the mask with the most number of white pixels
That color boundary used for that mask corresponds to the card type
A sample output can be seen below
Defining these color boundaries can be tedious it is to be done in HSV notation and manipulation one or more values make the color boundary so that it detects more colors other than the desired one.
How can you communicate?