This project focuses on color classifying by K-Nearest Neighbors Machine Learning Classifier which is trained by R, G, B Color Histogram. It can classify White, Black, Red, Green, Blue, Orange, Yellow and Violet. If you want to classify more color or improve the accuracy you should work on the training data or consider about other color features such as Color Moments or Color Correlogram.
What does this program do?
- Feature Extraction: Perform feature extraction for getting the R, G, B Color Histogram values of training images
- Training K-Nearest Neighbors Classifier: Train KNN classifier by R, G, B Color Histogram values
- Classifying by Trained KNN: Read Web Cam frame by frame, perform feature extraction on each frame and then classify the mean color of it by trained KNN classifier.
TODOs:
- "Add New Color" utility will be added.
- New feature extractors will be added.
- New classifiers will be added.
In this study, colors are classified by using K-Neares Neşghbor Machine Learning classifier algorithm. This classifier is trained by image R, G, B Color Histogram values. The general work flow is given at the below.
You should know 2 main pheomena to understand basic Object Detection/Recognition Systems of Computer Vision and Machine Learning.
1) Feature Extraction
How to represent the interesting points we found to compare them with other interesting points (features) in the image.
2) Classification
An algorithm that implements classification, especially in a concrete implementation, is known as a classifier. The term "classifier" sometimes also refers to the mathematical function, implemented by a classification algorithm, that maps input data to a category.
For this project;
1) Feature Extraction = Color Histogram
Color Histogram is a representation of the distribution of colors in an image. For digital images, a color histogram represents the number of pixels that have colors in each of a fixed list of color ranges, that span the image's color space, the set of all possible colors.
2) Classification = K-Nearest Neighbors Algorithm
K nearest neighbors is a simple algorithm that stores all available cases and classifies new cases based on a similarity measure (e.g., distance functions). KNN has been used in statistical estimation and pattern recognition already in the beginning of 1970’s as a non-parametric technique.