Color Detection Using Python
Color detection is necessary to recognize objects, it is also used as a tool in various image editing and drawing apps. I write a simple Python code to detect the color in the image using OpenCV. In the following work, we will be detecting contours, shapes and colors of various geometrical figures in the sample given binary images using Python 2.7, Open Source Computer Vision Library (OpenCV). The very fundamental functions are used for processing the images, that involves loading them, and detecting various shapes and colors inside the given sample images.
TABLE OF CONTENT
COVER PAGE
APPROVAL PAGE
DEDICATION
ACKNOWLEDGEMENT
TABLE OF CONTENT
- INTRODUCTION
- STATEMENT OF THE PROBLEM
- AIM AND OBJECTIVES OF THE STUDY
- SCOPE OF THE STUDY
- SIGNIFICANCE OF THE STUDY
- DEFINITION OF COLOR DETECTION
- RESEARCH QUESTION
- LIMITATION OF THE PROJECT
- DEFINITION OF TERMS
- PROJECT ORGANISATION
CHAPTER TWO
2.0 LITERATURE REVIW
2.1 REVIEW OF THE STUDY
2.2 REVIEW OF DIFFERENT TYPES OF COLOURS
CHAPTER THREE
3.0 METHODODLOGY
3.1 INTRODUCTION
3.2 PROGRAM DESCRIPTION
3.3 SYSTEM FLOW CHART
3.4 PYTHON VS OTHER PROGRAMMING LANGUAGES FOR COMPUTER VISION
3.5 STEPS FOR DETECTING COLOR IN AN IMAGE
CHAPTER FOUR
4.0 RESULT
4.1 PROGRAM CODE
4.2 APPLICATIONS AND FUTURE SCOPE
4.3 CHALLENGES
CHAPTER FIVE
5.1 CONCLUSION
5.2 REFERENCES
CHAPTER ONE
1.0 INTRODUCTION
1.1 BACKGROUND OF THE STUDY
Color detection is the process of detecting the name of any color. Simple isn’t it? Well, for humans this is an extremely easy task but for computers, it is not straightforward. Human eyes and brains work together to translate light into color. Light receptors that are present in our eyes transmit the signal to the brain. Our brain then recognizes the color.
Color recognition is the process of segmenting the colors and identifying the segmented colors. It is the one of the human to computer interaction. Here the colors are acting as interface between human and computer. At initial primary color modal is used for a recognition process, it only recognizing primary colors In the every color images, primary colors are segmented and segmented colors are recognized to identify its name like red, green, blue. It gives the recognized color as a output by using two ways, that is printing text on the output screen and playing audio(.wav) files which having the names of the primary colors. The pixels of every three colors are counted after segmented it. Whenever it gets above 300 pixels of these three colors (RGB) it should recognizes that the given colors are found. That we set that below 300 pixels are not any object found there. It may be a diffraction from light. So that it should not consider the colors below 300 pixels of the primary colors. Also the other colors are also neglected. These are the core process of color recognition. In the real time process, real time signals are processed by certain algorithms, for this project real time input signal is continuous motion of image signal i.e., video signal. It does not have any finite duration, algorithm monitoring for every frame and processing by the given algorithm.
In this color detection Python project, we are going to build an application through which you can automatically get the name of the color by clicking on them. So for this, we will have a data file that contains the color name and its values. Then we will calculate the distance from each color and find the shortest one.
1.2 PROBLEM STATEMENT
Detecting colours with our physical eyes is always difficult in the sense that some colours resemble one another. Also, Color vision deficiency is commonly known as color blind, is a type of vision defect in our eyeball. The inability to recognize color has caused several problems to the patient daily life and in conducting certain color oriented activities. Colour detecting system makes it easier and simple when detecting colours. This system was design in a way that it will automatically get the name of the color by clicking on them
1.3 OBJECTIVE OF THE STUDY
In this color detection Python project, the objective of this study is to build an application through which you can automatically get the name of the color by clicking on them.
1.4 SIGNIFICANCE OF THE STUDY
We will be working with colors and you will get to learn about many concepts throughout this project. Colour detection is necessary to recognize objects, it is also used as a tool in various image editing and drawing apps.
1.5 SCOPE OF THE STUDY
Colors are made up of 3 primary colors; red, green, and blue. In computers, we define each color value within a range of 0 to 255. So in how many ways we can define a color? The answer is 256*256*256 = 16,581,375. There are approximately 16.5 million different ways to represent a color. In our dataset, we need to map each color’s values with their corresponding names. But don’t worry, we don’t need to map all the values. We will be using a dataset that contains RGB values with their corresponding names.
In this work, we design and implement a color recognizer using Python. This process is also known as “Color Detection”. We will create a basic application that will help us to detect the colors in an image. The program will also return as the RGB values of the colors, which is really helpful. Many graphic designers and web designers will understand how RGB values can be helpful. Building a color recognizer is a great project to get started with Computer Vision.
1.6 DEFINITION OF COLOR DETECTION
Color detection is the process of detecting the name of any color. Simple isn’t it? Well, for humans this is an extremely easy task but for computers, it is not straightforward. Human eyes and brains work together to translate light into color. Light receptors that are present in our eyes transmit the signal to the brain. Our brain then recognizes the color.
1.7 RESEARCH QUESTION
- What is color detection?
- How can I find out the number of colors in an image?
- How do I identify a color in python?
- How do I find the color of an image in Python?
1.8 DEFINITION OF TERMS
Gray Conversion: It is the process of conversion from color images into gray scale image. Color image contains 24 bits per pixel; it is reduced into 8 bits per pixel. Most commonly gray levels represent the interval number of quantization in gray scale image processing. At present, the most commonly used storage method is 8-bit storage. There are 256 gray levels in an 8 bit gray scale image, and the intensity of each pixel can have from 0 to 255.
Subtraction: The RGB image contains 24 bits, each of three colour shaving 8 bits per pixel. At parallel RGB is splitting into each 8 bit colours.
The colour subtraction is the process of subtracting the colour values between the two colours. Here each three colours are subtracted with the gray image which converted from the original RGB image.
Binary Conversion: Binary conversion is the process of converting any kind of image into a binary image. Basically binary image two bits image, it contains only 0 and 1.Here 1 will be represented as white and 0 will be represented as black. Hence it’s called as black and white image. The purpose of conversion is to count the white and black pixels in the image. Each separated colouris converted as white and other colours are converted as black.
Multiplication Image: multiplication is the process of multiplication of pixel values between two or more images; here this process is used to multiply binary images with splitted color images. At the end of this process we can get each primary colors that having above 300 pixels. The area contains below 300 pixels does not considered as color. After the multiplication this process having three segmented colors that having 300 pixels. By combining these three colors we can get the segmented color image that contains only primary colors.
The Title Page should be the first section of your project “Color Detection Using Python”, providing essential details like the project title, your name, your supervisor’s name, the institution, and the submission date. After that, the Abstract offers a brief summary of your project, touching on its purpose, methods, results, and conclusions in 150-300 words. The Acknowledgments section is where you can thank those who supported your research, such as your supervisor, peers, or organizations that provided resources.
Next, the Table of Contents organizes the Color Detection Using Python by listing its chapters and sections, along with page numbers for easy reference. The List of Figures and List of Tables help guide readers to specific visual elements like graphs, charts, or tables included in the document. There should also be an Abbreviations and Glossary section to explain any specialized terms or acronyms, making the content clearer to readers unfamiliar with the technical language.
The main body of the Color Detection Using Python should start with the Introduction, which provides background information, outlines the research problem, states your objectives, and gives a brief overview of your research methods. Following that, the Literature Review offers an in-depth look at previous research relevant to your project, identifying gaps your study aims to address. The Methodology section then explains the research design, tools, and data collection methods you used to conduct the project and analyze the data.
In the Results and Discussion section, you present your findings and discuss them in relation to the Color Detection Using Python research questions or objectives, often using tables or charts to help explain the data. The Conclusion summarizes the key results, discusses their implications, and suggests possible directions for future research. You may also include recommendations based on your findings, offering practical advice for improvements or applications. Finally, the Color Detection Using Python project should include a References or Bibliography section to list all the sources you cited, as well as Appendices for any additional material. A Statement of Originality is often included to confirm the authenticity of your work