Você está na página 1de 3

Image processing with color-based segmentation using K-

means clustering algorithm and Color Histogram algorithm

Christian R. Viernes Justinne Joy Francisco Val Kenneth Arado


BS Computer Science BS Computer Science BS Computer Science
University of Mindanao University of Mindanao University of Mindanao
+63 975 100 9279 +63 900 000 0000 + 63 900 000 000
christian_viernes@umindanao.edu.ph justinnejoy_francisco@umindanao.edu.ph Valkenneth_arado@umindanao.edu.ph

Meljohn V. Aborde, MIT


University of Mindanao
+63 949 645 5502
mjaborde@umindanao.edu.ph

Categories and Subject Descriptors create an image histogram. The data of the histogram will be
I.4.6 [Image Processing and Computer Vision]: Image analyzed then using the formula of color indexing, the
Segmentation algorithm will compare the data to the datasets to identify
which disease the leaf is infected with.
General Terms This proposed study will be the future tool to provide several
Algorithms, Clusters, Banana Leaf, Dataset, Image Pattern benefits to our local famers such as detection of possible
diseases that the banana is infected with, rapid detection to
Keywords enable saving time and money, and increases the productivity.
K-Means Clustering, Image Histogram, RGB Color Space Hence, the present work aims to develop an algorithm that will
benefit not just the farmers but also the future banana
1. INTRODUCTION productions in the Philippines.

1.1 Background of the Study 1.2 Objectives


Image segmentation plays a vital role in image analysis and
computer vision system. Among all segmentation techniques, 1.2.1 General
the color-based segmentation methods are widely used because The main goal of this research is to propose an algorithm that
of their advantages of simple implement, time saving and can diagnose an image of a banana leaf by combining K-Means
generate more accurate results. Through combining with K- Clustering algorithm, Image Histogram algorithm and color
Means Clustering Algorithm, it creates clusters that separates indexing formula.
different hues to produce vivid patterns in analyzing and 1.2.2 Specific
classify images accurately. It is needed to reach the following specific objectives to achieve
A histogram is an accurate representation of the distribution of the main goal of this project:
numerical data. In image processing and photography, a color
histogram is a representation of the distribution of colors in an 1.2.2.1 To convert the image from RGB Color Space to Lab
image. For digital images, a color histogram represents the Color Space using rgb2lab Color Conversion.
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 1.2.2.2 To classify the colors in Lab Space and to create images
colors. The color histogram can be built for any kind of color that segment the original image by color using K-Means
space but is often in spaces like RGB or HSV. It differs from a Clustering.
bar graph, in the sense that a bar graph relates two variables,
but a histogram relates only one. 1.2.2.3 To analyze the cluster with the infected part and create
a Color Histogram based on the cluster.
Therefore, the researchers have decided to combine the color-
based segmentation using K-Means Clustering algorithm and 1.2.2.4 To compare the data of the Color Histogram to the
Color Histogram combining. The algorithm is focused in dataset using the color indexing formula.
classifying what type of disease the plant leaf is suffering from.
This thesis is an experimental study to prove that the proposed 1.2.2.5 To test the results of the proposed algorithm if it can
algorithm can classify the disease of the banana plant leaf. identify the type of disease.
1.3 Scope and Limitations
This study will focus on developing an algorithm to identify
1.1 Purpose and Description banana leaf disease by combining Color-based Segmentation
The purpose of this research is to test the effectiveness of K- using K-Means Clustering and Color Histogram. This study
Means Clustering algorithm combined with Color Histogram will allow farmers and the future researchers in creating a more
in detecting the type of disease the banana leaf is infected with. advanced image processing process not just for banana
The proposed algorithm will cluster the processed image to plantations but also for all agricultural businesses.
separate the infected part of the leaf from the healthy part. The
separated infected part will then have its pixels analyzed to This study is only limited to create diagnostics based on
illnesses present in the Philippines. Also, the proposed study

1
will not be able to determine the severity and complexity of the The abovementioned figure is an example representation on
diseases. how RGB Color Space is converted to Lab Color Space. As
shown in the figure, the Hematoxylin and Eosin (H&E Stain)
REVIEW OF RELATED image’s colors is converted to three distinct colors which
separates the original hues to create clearer interpretation of the
LITERATURES image.
(ADD RRL HERE)

3.2.2 Classify the Colors Using K-Means


TECHNICAL BACKGROUND Clustering
After the original image is converted to Lab Color Space, the
next process is to create different clusters using K-Means
3.1 Conceptual Framework Clustering Algorithm in which each color is to be classified
individually. The main goal of this method is to differentiate
and identify the groups in the data. Using the formula:

𝑘 𝑛
𝑗 2
𝐽 = ∑ ∑‖xi −𝑐𝑗 ‖
𝑗=1 𝑖=𝑖

Where J is the object function, k is the number of clusters to be


made, n is the number of cases, Xi is the case for I, Cj for the
𝑗 2
cluster j, and ‖xi −𝑐𝑗 ‖ is the distance function. The formula
will result in:
Figure 1 Conceptual Framework

As shown in Figure 1, the input image original color will be


converted to Lab Color Space. Then, the K-Means clustering
algorithm will differentiate the healthy part and the infected
part into clusters. Then create a color histogram based on the
cluster. The garnered data will then be analyzed and compared
using color indexing formula to produce an output on the
matched disease and possible treatments of the disease.

3.2 Color-Based Segmentation Using K-


Means Clustering Figure 3 Different clusters for each color
The goal of this process is to eliminate all the healthy parts of
the banana leaf from the image so that the image will only As shown in the figure above, the Cluster 1 is derived from the
contain the infected parts of the leaf. This will decrease the black part of the Cluster Index (Figure 2). The Cluster 2 is the
number of pixels of the image to be analyzed. This will result gray part and the Cluster 3 is all part that is covered in white.
in the learning process of the Convolutional Neural Network to
accelerate and give more accurate findings.
3.2.3 Pattern Identification
3.2.1 Convert Image from RGB Color Space After grouping and differentiating the colors of the image, the
algorithm will then create a cluster containing only the
to Lab Color Space discolored part of the image and label it as nuclei. The cluster
Converting the RGB Color Space to Lab Color Space will
will be the basis to identify the pattern that is associated in the
quantify the color differences contained in the image. The Lab
consists of layer “L” where luminosity layer is placed, layer “a” dataset using the Color Histogram algorithm.
where colors with red and green are placed, and layer “b” where
colors with blue and yellow are placed.

Figure 2 RGB Color Space to Lab Color Space Figure 4 Segment of the Cluster 3

2
The aforementioned image is extracted from the Cluster 3 The min function is an argument where it takes two values and
which contains the blue objects. As shown in the image, there return the smallest one. The result of the intersection is the
are dark and light blue objects. The dark blue objects are the number of pixels from the model that have corresponding
cell nuclei which is separated from light blue objects using the pixels of the same colors in the input image.
L layer in the Lab Color Space. The L layer contains the
brightness values of each color. Through extracting the
brightness values of the pixel in this cluster and threshold them 3.3.2 Normalizing the result
with the algorithm, it will a clearer interpretation of the hues To normalize the result between 0 and 1 we divide it by the
underneath the cluster. number of pixels in the model histogram using the formula:

3.3 Image Color Histogram Analysis ∑𝑛𝑗=1 min(𝐼𝑗 , 𝑀𝑗)


𝑋=
∑nj = 1Mj
The Cluster 3 which contains visible blue nuclei is to be
analyzed to create a color histogram. When an unknown object image is given as input we compute
the histogram intersection for all the stored models, the highest
3.3.1 Creating the Color Histogram value is the best match.
Store the value of each red, green, blue component in three
different arrays. Find the image histogram of red, green, blue 3.4 Development Tools
component of the image. Store the histogram value of red, The following are the different tools used to design and develop
green, blue component in three arrays.
the proposed study:
3.5.1. PHP- an interpreted high-level programming language
for general-purpose programming.

REFERENCES
[1] O'Shea, Keiron & Nash, Ryan. (2015). An Introduction to
Convolutional Neural Networks. Retrieved from
https://arxiv.org
[2] Deenan, Surya Prabha & SatheeshKumar, J. (2014). Study
on Banana Leaf Disease Identification Using Image Processing
Methods. Retrieved from www.researchgate.net
[3] Amara, J., Bouaziz, B., & Algergawy, A. (2017). A Deep
Learning-based Approach for Banana Leaf Diseases
Figure 5 Color Histogram Classification. Retrieved from www.semanticscholar.org
[4] Website. (n.d.). Color-Based Segmentation Using K-Means
3.3.2 Intersection of two images Clustering. Retrieved from https://www.mathworks.com
Given the histogram I of the input image and the histogram M [5] Website. (2017). How to Use The Pre-Trained VGG Model
of the dataset, each one containing n bins, the intersection is to Classify Objects in Photographs. Retrieved from
defined as: https://machinelearningmastery.com
𝑛

𝑋 = ∑ min(𝐼𝑗 , 𝑀𝑗)
𝑗=1

Você também pode gostar