Color Recognition Algorithm
Color Recognition Algorithm
Abstract- This paper presents a simple color recognition License Plate Recognition have proposed the application of
algorithm using a Neural Network model and applied to the information fusion enhanced color recognition technology
determine the ripeness of a banana. The captured image of the in stolen vehicle identification. [4]
banana is resized and its RGB color components are extracted. This application also can be useful in reducing time
The color components of the resized images are rescaled using a
simple heuristic method. Further, a histogram for the rescaled
consuming and work efficiency for customers and cashiers in
image is obtained and used as a feature vector to identify the billing counters. For instance this can be applied when buying
ripeness of the banana. A simple graphical user interface system fresh vegetables or fruits. Normally, the weighing system is
is developed in MATLAB that classifies the ripeness of the used for cashiers to determine the prices of the fruits or
banana. The proposed model has an accuracy of 96%. vegetables. However this color recognition system can
substitute the weighing system and it is capable to recognize
Keywords - Color Recognition, Neural Network, RGB, the type of fruits or vegetables based on the color of the
Histogram, Ripeness of Banana. scanned image.
Therefore, in this research, a simple algorithm method using
I. INTRODUCTION
the MATLAB is proposed to determine the ripeness color of a
fruit and the sample of the fruit used is banana. The image of
The normal human eyes have three types of sensors banana is captured and resized. Later, the image is extracted
and the signal of these three sensors determine the color into the RGB color components and each pixel of the color
response of the observer. The response of this system component is rescaled using a simple heuristic method. As a
produces the three-dimensional phenomenon of three result, histograms are obtained and used as the feature vector
dimensional spaces. When a human sees something, the light in determining the ripeness of the banana. A simple algorithm
enters the eye and hit the light detector on the retina. This method is proposed and the program is eventually presented
behaves similarly to a digital camera that records more using the graphical user interface.
reading whenever more lights hit the light detector on the back II. SYSTEM DESIGN
of the camera. Therefore in the electronics graphical system
RGB color model is similarly applied to provide such The RGB images of bananas are captured using a Web
coordinate system of three dimensional spaces. [1] Digital Camera. The captured images have the resolution of
In electronics graphic system, RGB color model is 320x240 pixels. In this research work, many environmental
commonly used for input and output devices such as color TV, have to be considered such as the position of the camera,
digital cameras, video recorder, computer screen, and LCD. lighting sensitivity, and background conditions as this
Computer monitors for instance use the RGB color and the elements have probabilities to effect the collection of the data.
computer images are commonly stored in RGB color system. The camera is placed 15 centimeters above the sample as in
[2] RGB color system is based on three basic color (A) in Figure 1. The banana is placed on a black paper that
components of red, green and blue in pixel {r, g, b}.In a true laid on the ground as in (C) in Figure 1. The device is
image color, for each color component, there is a range of equipped with two similar power of bulbs throughout the
intensity, from 0 to 255 and when these three combinations of capturing process in providing sufficient lighting to the sample
various intensities are superimposed, a colorized hue is as in (B) shown in Figure1. It is important to have similar and
obtained. [3] constant camera and light sources as different cameras and
From this theory, the color recognition model has been different light sources create different pixel intensities. [5]
applied widely in industrial sectors, commercial fields as well
as in social responsibilities. For instance, it is used as a III. METHODOLOGY
powerful and reliable parameter in robotics machines, aid for
the blind and the color blind people, diamond color sorting, This system is designed to identify the ripeness of the
quality control for the manufacture colored paper, [9] and in banana. There are four sets of bananas used in the research
characterizing the thermal paints. [10]. Rami Al-Hmouz and with different type of sizes and ripeness. Each set contains of
Subhash Challa in their research in the field of Automatic between 10-14 pieces of banana. Each image of the banana is
2B7-1
Proceedings of the International Conference on Man-Machine Systems (ICoMMS)
11 13 October 2009, Batu Ferringhi, Penang, MALAYSIA
captured in four different positions and the images are that lies between 86-170, it will be rescaled to 122 and for
captured daily until all bananas turn to be rotten. It has three 171-255, the color component will be rescaled to 255.
main stages; preprocessing, feature extraction and ripeness Therefore color histograms are obtained for each color
classification. component by counting the number of pixels that have same
color scales in the image array as shown in the example in
Figure 3.5, 3.6 and 3.7.These histograms are used as the
Capturing Images
Preprocessing
Extracting the RGB
components of the image
Neural Network
Ripeness
Classification
Fig. 1. Stand that holds the web digital camera at (A), two bulbs at (B) and the
banana will be laid on the ground on (C) Classified Ripeness Color
2B7-2
Proceedings of the International Conference on Man-Machine Systems (ICoMMS)
11 13 October 2009, Batu Ferringhi, Penang, MALAYSIA
The Network Architecture has one output layer of 9 input chosen as 400. The initial weights for this Neural Network are
neurons, 45 hidden neurons and one output layer with one randomized between -0.5 and +0.5. A trial weight set consist
output neuron. Both the hidden and output layer neurons are of 20 sets of randomized weight samples are considered. The
activated by binary sigmoid activation function. If the output testing tolerance used is 0.2. 60% samples are used for
is 1 then the fruit is ripe and if it is closer to zero then it training and all 100% samples are used for testing.
Figure 3.5 The number of pixels versus the color scales for the red component
Figure 3.6 The number of pixels versus the color scales for the green
component
2B7-3
Proceedings of the International Conference on Man-Machine Systems (ICoMMS)
11 13 October 2009, Batu Ferringhi, Penang, MALAYSIA
[8] Juan R.Rabual and Julin Dorado (2006), Artificial Neural Networks in
Real-Life Applications, IGI Publishing.
[9] M Stoksik, D T Nguyen, M Czemkowaki, A Neural Net Based Color
Recognition System, University Of Tasmania, Australia.
[10] Tristan Lalanne and Christine Lempereur (). Color Recognition with a
Camera, A Supervised Algorithm Recognition, Toulouse Cedex, France.
Figure 3.7 The number of pixels versus the color scales for the blue
component
IV. CONCLUSION
REFERENCES
[1] Peter Shirley (2005), Fundamentals of Computer Graphics, A K Peters,
Ltd. is a leading independent scientific technical publisher based in
Wellesley, Massachusetts.
[2] Fortner, B. and Meyer, T. E. (1997), Number by Colors, Springer-
Verlag, New York.
[3] Sun, W. and He, Y. (1998), Spatial-chromatic clustering for color
image compression, Proceedings of I998 IEEE World Congress on
Computation Intelligence, FUZZ-IEEE, pp. 160 1 1604
[4] Rami Al-Hmouz, Subhash Challa (2007), Intelligent Stolen Vehicle
Detection using Video Sensing, Networked Sensors Technologies Lab,
University Of Technology Sidney
[5] Swain,M.J, and Ballard, D.H.,Indexing Via Color Histograms, In
Proceeding of Third International Conference on Computer Vision,pp.
390-393,1990
[6] Ennesser, F., and Medioni G. Finding Waldo, or Focus of Attention
Using Local Color Information, In IEEE Transactions on Pattern
Analysis and Machine Intelligence, vol 17, No 8, pp. 805-809, Aug
1995,
[7] S.N. Sivanandam, M. Paulraj (2003), An Introduction to Neural
Networks, Vikhas Publications Company Ltd. India.
2B7-4