Color Detection

Download free bootstrap 4 landing page, free boootstrap 4 templates, Download free bootstrap 4.1 landing page, free boootstrap 4.1.1 templates, meyawo Landing page

About

This is the color detection process for the card to determine what kind of card it is.

How does it work?

The Function Call
1

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

Download free bootstrap 4 landing page, free boootstrap 4 templates, Download free bootstrap 4.1 landing page, free boootstrap 4.1.1 templates, meyawo Landing page
2

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

Download free bootstrap 4 landing page, free boootstrap 4 templates, Download free bootstrap 4.1 landing page, free boootstrap 4.1.1 templates, meyawo Landing page
3

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

Download free bootstrap 4 landing page, free boootstrap 4 templates, Download free bootstrap 4.1 landing page, free boootstrap 4.1.1 templates, meyawo Landing page

Some Problems that occurred
Defining Color Boundaries

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?

Contact Me