[go: up one dir, main page]

0% found this document useful (0 votes)
5 views5 pages

26 Iccs18cs132

Uploaded by

RifHans 04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

26 Iccs18cs132

Uploaded by

RifHans 04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Journal of Computer Sciences and Engineering Open Access

Research Paper Vol.-7, Special Issue, 5, March 2019 E-ISSN: 2347-2693

Fruits Classification Using Image Processing Techniques


PL.Chithra1* , M.Henila2
1
Dept. of Computer Science, University of Madras, Chennai, TN, India
2
Dept. of BCA, Ethiraj College for Women, Chennai , TN, India
*
Corresponding Author: chitrasp2001@yahoo.com, Tel.: +91-9176202211

DOI: https://doi.org/10.26438/ijcse/v7si5.131135 | Available online at: www.ijcseonline.org

Abstract— A new method for classifying fruits using image processing technique is proposed in this paper. The data set used
had 70 apple images and 70 banana images for training and 25 images of apple and 25 images of bananas for testing. RGB
image was first converted to HSI image. Then by using Otsu’s thresholding method region of interest was segmented by taking
into account only the HUE component image of the HSI image. Later, after background subtraction, a total of 36 statistical and
texture features were extracted with the help of the coefficients obtained by applying wavelet transformation on the segmented
image using Haar filter. Extracted features were given as inputs to a SVM classifier to classify the test images as apples and
bananas. As KNN classification method did not give 100% accuracy while classification SVM classification method was used.
140 sample images of apples and bananas were used for training and 25 images of banana and 25 images of apples were used
for testing the proposed algorithm. The proposed algorithm gave 100% accuracy rate.
Keywords— RGB, HSI, Region of interest, Wavelet domain, Haar filter, SVM classification.

I. INTRODUCTION D Sahu, et al., proposed a method to identify and classify


mango fruits using image processing techniques [1].
Machine vision system for fruit identification and disease K Tarale ,et al., have introduced a fruit detection using
identification of fruit or vegetable is one among the current morphological image processing technique [2]. K Tarale , et
topic that is under research in the agriculture industry. As a al., have proposed a new method for fruits recognition
part of this current research area, this fruits classification system[3]. W C Seng ,et al., have proposed a survey paper
using image processing techniques was developed. on image processing methods for fruit classification [4]. S P
This classification of fruits can be used to identify a fruit and Deevan ,et al., introduced an automatic fruit classification
generate its price automatically in a shop or supermarket. As method using random forest algorithm[5]. H M Zawbaa, et
an initial step in this proposed methodology classification of al., have proposed an algorithm for classification of citrus
apples and bananas was done. Even agriculturist will be fruit using image processing – GLCM parameters[6]. H M
benefited if an automation machine vision exits to classify Zawbaa, et al., have discussed about an automatic fruit image
different variety of fruits and vegetables in the agriculture recognition system based on shape and colour features[7]. A
industry. robust approach for fruit and vegetable classification was
proposed by S R Dubey , et al.,[8]. Apple fruit size
Rest of the paper is organized as follows, Section I contains estimation using a 3D machine vision system was introduced
the introduction of this research paper fruit classification by A Gongal ,et al.,[9]. Another method was found by W
using image processing techniques , Section II contain the Wang, et al., to find the mechanical damage caused by fruit-
existing works related to fruit classification systems, Section to-fruit impact of litchis[10]. Using geometry based mass,
III contain some measures used in the proposed algorithm grading of mango fruits using image processing techniques
and their explanations, also it explains the architecture and was proposed by M A Momin , et al.,[11]. The above listed
essential steps of the proposed fruit classification system, research papers were surveyed in order to develop this
Section IV explain about the results obtained by proposed methodology.
implementing the proposed algorithm using MATLAB
software , also it discusses about the features and advantages III. METHODOLOGY
of the proposed algorithm, and finally Section V concludes
with suggestion for future enhancement of this research Image processing techniques like image reading, image
work. colour space conversion , background subtraction , image
II. RELATED WORK segmentation , masking , dilation , region fill , wavelet
transformation, feature extraction using GLCM ,etc., were

© 2019, IJCSE All Rights Reserved 131


International Journal of Computer Sciences and Engineering Vol. 7(5), Mar 2019, E-ISSN: 2347-2693

used. In order to classify fruits commonly extracted features 3.4 Proposed Algorithm
are related to the statistical, colour, intensity, shape and The steps involved in the proposed method are depicted in
texture. For this experiment statistical and texture features the algorithm given below.
were used.
Algorithm :
3.1 Samples used 1 : Load RGB image
For experimentation a total of 140 images were taken for 2 : Convert RGB image to HSI image
training and 50 images was taken for testing. Out of these 3 : Taking the Hue component image and
140 training images, 70 apple images [granny smith, fuji, red subtract its background
delicious variety and 70 banana images [yellow and green 4 : Obtain ‘T’ threshold using OTSU’s method
variety] were taken and out of 50 test images 25 apple 5 : Extract the ROI using the same and fill the holes.
images [granny smith, fuji and red delicious variety ] and 25
banana [yellow and green] images were taken. 6 : Image with ROI alone is loaded

3.2 Image Acquisition 7 : Features like statistical and textural features were
RBG colour images can be acquired using a Digital camera extracted using Wavelet Transformation using
using an illumination chamber. All secondary images used Haar filter for all Vertical, horizontal and
for this research work were of sizes 800 x 800 pixels. diagonal coefficient values
8 : Extracted features from both training and testing
3.3 Proposed Method samples were given as input to SVM
The proposed method uses the following steps which have classification procedure.
been depicted using a flowchart below. This proposed 9 : Apple images and banana images were classified.
algorithm was coded and was executed using MATLAB
2017a software. As the first step region of Interest was 3.5 Region of Interest extraction
extracted from the extracted apple’s / banana’s image. After In this work the apple/banana image area was the Region Of
identifying the region of interest, the segmented image’s Interest. To extract the ROI, the acquired RGB image was
background was subtracted and the holes were filled using converted into HSI colour space. Hue component image was
morphological procedures. Then wavelet transformation taken into account for further study. After conversion the
using Haar filter was applied on the ROI image. A total of 36 background of the image was subtracted. Then ‘Th’ value
statistical and texture features using the diagonal, vertical was obtained using Otsu’s method. Here gri(x,y) was the
and horizontal coefficient values of the wavelet domain were background subtracted image.
extracted. Using the extracted features of apple/banana ( )
images were well classified using SVM classifier as images ( ) {
( )
of apple and bananas. The following flowchart depicts the (1)
proposed algorithm.
Image holes may be there in the segmented image therefore
Acquired these image holes were filled using some morphological
apple image procedures to get the final ROI image.
STEP 1
ROI extraction 3.6 Feature extraction
This subsection discusses about the features that were
extracted to classify the apple and banana samples using the
STEP 2 proposed algorithm.
Feature extraction using wavelet
transformation using Haar filter 3.6.1 Wavelet transformation
Images in general are not always clearly defined in special
domain. This in turn will not help in accurate classification.
STEP 3 So, DWT (Discrete Wavelet Transformation) coefficients of
Classification using SVM classifier diagonal, vertical and horizontal pixel values were obtained.
Further statistical and texture features were calculated using
these level one coefficient values and level two coefficients.
Apples Bananas Haar filter was used to decompose the images.

Figure 1. Diagrammatic representation of the proposed method 3.6.2 Statistical features

© 2019, IJCSE All Rights Reserved 132


International Journal of Computer Sciences and Engineering Vol. 7(5), Mar 2019, E-ISSN: 2347-2693

For first and second level decomposition of the segmented groups here the objects are green and red colours with a line
image, statistical features like mean and standard deviation that correctly classifies new objects called test cases on the
were calculated. A total of 12 features [ Mean value for CH , basis of the examples that are available as train cases.
CV , CD and Standard Deviation for CH , CV , CD] for each In the proposed methodology, SVM classification was used
image was calculated. to classify the apples and bananas under two headers and was
stored in two separate folders.
Mean = µ = ∑ ∑ ( ) (2)
IV. RESULTS AND DISCUSSION
√( ( ) )
Standard Deviation = = (3)
4.1 Results
Out of 50 test images used for testing 12 test image samples
3.6.3 Texture features results are taken for discussion in this section. After STEP 1
Texture features like Energy , Homogeneity , Contrast and phase of the proposed methodology the following output was
correlation for CH , CV , CD at first and second level obtained.
decomposition of DWT was calculated. And a total of 24
features were obtained.

Energy = √∑ ∑( ( ) (4)
i j
Energy give us the sum of squared elements.

( )
Homogeneity = ∑ ∑ ( )
(5)

This measures the closeness of the distribution of elements in


the GLCM

Contrast = ∑ ∑ ( ) ( ( )) (6)

The local variations in the gray-level co-occurrence matrix (a)


was given by Contrast measures

( )( )
Correlation = ∑ ( ) (7)

The joint probability occurrence of the specified pixel pairs


was given by the Correlation measures
In formulae 2 thru 7 ‘Im’ was the segmented image, M x N
was the size of the image with M rows and N columns.
Where i vary from 1 to M, and j vary from 1 to N.

3.6.4 SVM Classification


Support Vector Machines are based on the concept of
decision planes that define decision boundaries.

(b)
Figure 3. a) RGB image original image , converted HSI image , Hue
component image and image after morphological procedure of an apple
Figure 2. SVM Classifier illustration diagram sample. b) RGB image original image, converted HSI image, Hue
component image and image after morphological procedure of a banana
Figure 2 illustrates a SVM classifier diagrammatically. SVM sample.
classifier separates a set of objects into their respective

© 2019, IJCSE All Rights Reserved 133


International Journal of Computer Sciences and Engineering Vol. 7(5), Mar 2019, E-ISSN: 2347-2693

From the above figures a and b it was evident that the Hue Table 4. Statistical features at level two.
component image of an apple/banana image gave a clear
picture of the ROI. Also, figures a and b also shows images
that were obtained after the background subtraction
procedure and the image that was obtained after the
application of Otsu’s thresholding algorithm.

The following tables from one through 4 are the 36 feature


values extracted after applying wavelet transformation on the
segmented image using Haar filter. Statistical and texture
features found out using horizontal , vertical and diagonal
coefficients are tabulated in the following tables. For these 12 test sample images the output obtained after
applying SVM classification method the graph got plotted as
Table 1. Texture features at level one follows:

Figure 4. Scatter diagram of SVM classification output

Table 2. Statistical features at level one In the above scatter diagram ‘x’ represents a banana image
and ‘+’ represents an apple image. Out of the 12 test sample
images 5 images were banana images and 7 images were
apple images.

Table 3. Texture features at level two


(a)

(b)
Figure 5. (a) Apple test images (b) Banana test images

© 2019, IJCSE All Rights Reserved 134


International Journal of Computer Sciences and Engineering Vol. 7(5), Mar 2019, E-ISSN: 2347-2693

Also this research work can be extended to help the


agriculturist to classify different varieties of apples and
bananas.

REFERENCES

[1] Sahu, Dameshwari, and Chitesh Dewangan. "Identification and


Classification of Mango Fruits Using Image Processing." Int. J. Sci.
Res. Comput. Sci. Eng. Inf. Technol 2.2 (2017): 203-210.
[2] Tarale, Ketki, and Anil Bavaskar. "Fruit Detection Using Image
Processing Technique." National Conference on Advances in
Engineering and Applied Science (NCAEAS). 2017,(3)2: 178-183
[3] Seng, Woo Chaw, and Seyed Hadi Mirisaee. "A new method for
(a) (b) fruits recognition system." Electrical Engineering and Informatics
Figure 6. (a) SVM Classification table ‘1’ – apple , ‘2’ – 2009. ICEEI'09. International Conference on. Vol. 1. IEEE, 2009.
banana [4] Prabha, D. Surya, and J. Satheesh Kumar. "A study on image
(b) Bar chart for SVM output processing methods for fruit classification." Proc. Int. Conf. on
Computational Intelligence and Information Technology, CIIT 2012.
[5] Zawbaa, Hossam M., Maryam Hazman, Mona Abbass, and Aboul
The above figure 6 gives the SVM classification table and its Ella Hassanien. "Automatic fruit classification using random forest
equivalent bar chart representation. algorithm." In Hybrid Intelligent Systems (HIS), 2014 14th
International Conference on, pp. 164-168. IEEE, 2014.
4.2 Discussion [6] Kumar, C., Chauhan, S., & Alla, R. N. (2015, April). “Classifications
The above listed results were obtained using 12 test samples of citrus fruit using image processing-GLCM parameters”.
In Communications and Signal Processing (ICCSP), 2015
taken out from the actual no. of 140 and 50 images used for International Conference on (pp. 1743-1747). IEEE.
training and testing. The above algorithm was coded and [7] Zawbaa, Hossam M., Mona Abbass, Maryam Hazman, and Aboul
tested using MATLAB software. Different apple varieties Ella Hassenian. "Automatic fruit image recognition system based on
and banana varieties that had different backgrounds were shape and color features." In International Conference on Advanced
taken for training and testing. SVM gave 100% accuracy Machine Learning Technologies and Applications, pp. 278-290
when compared to KNN classifier. Though there are so many Springer, Cham, 2014.
[8] Dubey, Shiv Ram, and A. S. Jalal. "Robust approach for fruit and
methods that are there in this field , this paper exposes a vegetable classification." Procedia Engineering 38 (2012): 3449-
different methodology wherein the given RGB when 3453.
converted to Hue gives 100% accuracy rate if SVM is used. [9] Gongal, A., M. Karkee, and S. Amatya. "Apple fruit size estimation
Apart from the existing methods of extracting colour features using a 3D machine vision system." Information Processing in
, this methodology uses texture features and statistical Agriculture 5, no. 4 (2018): 498-503.
[10] Wang, Weizu, Zhou Yang, Huazhong Lu, and Han Fu. "Mechanical
feature for all the coefficients obtained from wavelet
damage caused by fruit-to-fruit impact of litchis." IFAC-
transformation using Haar filter at both level one and level PapersOnLine 51, no. 17 (2018): 532-535.
two. Only the Hue component image was considered for [11] Momin, M. A., et al. "Geometry-based mass grading of mango
experimentation from the HSI image as it alone gave 100% fruits using image processing." Information Processing in
classification accuracy Colour features were not used to Agriculture, 4.2 (2017): 150-160.
classify the image that was one among the unique feature of
this proposed system.

IV. CONCLUSION AND FUTURE SCOPE

Sample images of apples and bananas were alone taken for


experimentation, in future few more fruits or vegetables can
be taken as samples for experimentation.
Images having white background alone can only be
considered for testing this algorithm using KNN classifier.
Sample images should be acquired at 360 degrees in order to
obtain 100% accuracy in real time classification of any fruit
or vegetable in the agriculture industry. Thus a machine
vision system for segregating/ classifying apple fruit and
banana fruit was developed and tested for 100% accuracy
and the same was obtained

© 2019, IJCSE All Rights Reserved 135

You might also like