Simple Color Recognition
Simple Color
Recognition
                 Eng.
                            Done by:
                            Abdulrhman Hussain Alkuribi – 273
                            Mohammed Ali Suliman - 264
Simple Color Recognition
Abstract
In this project, we are going to make a basic color recognition
using OpenCV python. The color of the pixel detected will be
shown on the screen.
Introduction
This project has utilized python, OpenCV library, and HSV
colors' type.
Python is dynamically-typed and garbage-collected. It supports
multiple programming paradigms, including structured
(particularly procedural), object-oriented and functional
programming. It is often described as a "batteries included"
language due to its comprehensive standard library.
OpenCV (Open Source Computer Vision Library) is an open
source computer vision and machine learning software library.
OpenCV was built to provide a common infrastructure for
computer vision applications and to accelerate the use of
machine perception in the commercial products. Being an
Apache 2 licensed product, OpenCV makes it easy for
businesses to utilize and modify the code.
HSV Color Scale: The HSV (which stands for Hue Saturation
Value) scale provides a numerical readout of your image that
corresponds to the color names contained therein. For HSV,
hue range is [0,179], saturation range is [0,255], and value
range is [0,255]. Different software uses different scales.
Simple Color Recognition
Applications
Color, one of the most influential attributes of light, has a
distinctive importance in various industries and scientific
applications. The color of a material can be used to evaluate
the properties of that material. Color detectors are employed to
recognize/detect the color of a material in RGB scale, or HSV
scale, while rejecting the unwanted infrared or ultraviolet light.
These color recognition systems are deemed highly suitable for
quality control applications in various industries, such as food,
automotive, glass, manufacturing, for ensuring high productivity
and cost reduction. Moreover, Color sensors are majorly used
to grade colored products, distinguish coded markings, detect
the presence of adhesives or data codes on a package. The
technology has a wide range of applications in various
industries such as textile, automation, automotive, food,
printing, pharmaceutical, and many more.
How to use the program
  - - Open the program on your computer, while it should
    have a webcam.
  - - Put the object in the center showed in the screen.
  - - The color will be printed on the upper left of the screen.
Simple Color Recognition
How does it work
It uses OpenCV library. It will pick the color of the center pixel, then
convert it to HVS scale. After that, the color of the pixel will be
detected and it will be printed on the upper left of the screen.
Colors recognized using this program
  -   Red
  -   Orange
  -   Yellow
  -   Green
  -   Blue
  -   Violet
  -   More colors will be added in the future
Tools used
  - Python
  - OpenCV
Simple Color Recognition
The code
Simple Color Recognition
Conclusion
To conclude, this is a simple project to detect the color of a
pixel on a live stream at a specific point using Python and
OpenCV library. It can be used in different areas, and it has so
many applications.
Future work and Recommendations
This program has to be developed to be used as a testing or
monitoring tool, so those are some points to be considered:
  - Take the lightness of the environment into your
    consideration.
  - Set the ranges of colors efficiently.
  - Add the colors you want to detect.
  - Always put the object int the center