You are on page 1of 8

AUTOMATIC FRUIT SORTING PANEL

B.S. ELECTRONIC ENGINEERING, BATCH 2016

Internal Advisor
Sir Saeed Azhar
Assistant professor
Electronic Engineering Department
SSUET, Karachi

Submitted by

M.UMERFAROOQ 2016-EE-189
M.A. HASEEB 2016-EE-077
M.SAAD KAMAL 2016-EE-192
SHAFIQ-UR-REHMAN 2016-EE-131

DEPARTMENT OF ELECTRONIC ENGINEERING


SIR SYED UNIVERSITY OF ENGINEERING AND
TECHNOLOGY, KARACH
AUTOMATIC FRUIT SORTING PANEL

Abstract—This paper discusses the development of portable quality. The rapid development of computer vision and image
fruit sorting and grading machine based on computer vision for processing bring through the solution to fabricate a low-cost
small agro-industries. The mechanical system is designed from and portable fruit’s sorting and grading machine for
low cost material in the form of inclined and segmented plane to small/home agro-industrial companies. Even more the
substitute the utilization of conveyor belt. In this case, motor availability of low-cost and smart robotics servo, dynamixel
servos are used as gate opener and director for the mechanical ax-12, can be applied as actuator in machine’s mechanical
system. The autonomous system collects video image from a system.
webcam placed on the top of analysis area, then the image will be
analyzed due to the process of computer vision. Firstly, the [4]. They used RGB color space, edge detection, and
computer vision algorithm transforms the RGB (Red, Green, and boundary tracing to determine color quality and dimension of
Blue) color space to HSV (Hue, Saturation, and Value) color mangoes. Different from them, this project uses HSV color
space of the image to facilitate the processes of color space and natural color segmentation to determine fruit
segmentation that are robust to the light intensity maturity and geometrics approach to determine fruit
fluctuation.Then the system will cluster fruit quality according to dimension. [5]. HSV color space was more reliable to be
the level of maturity and its dimension. In the end, the exploited in machine vision fruit grading and sorting.
autonomous system will actuate the servos to move the fruit to a
specific bin according to their quality grade. Then the result of
fruit analysis data will be displayed on PC’s monitor. The system II. COMPUTER VISION
can do the task in 500 ms with precision result. Computer vision is the transformation of data from a still
video camera into either a decision or a new representation. All
Keywords—portable fruit sorting and grading machine; such transformations are done for achieving some particular
computer vision; HSV color space; servo-based sorter; low cost goal [7]. In other words, computer vision is the representation
mechanical design
of image in another form after undergoing computation. The
new representation of image can be decision data, analytical
I. INTRODUCTION data including parameters, graphic describing specific
In agrarian country - like Pakistan, agro-industrial information, or another representation. The computer vision is
companies are the major and vital sectors which drive the related to image processing techniques to manipulate the image
economic growth. The supporting technology has to be data by applying image enhancement, image restoration, image
developed to boost the production of this sector. One of analyzing, etc. In this project, the computer vision is needed to
supporting technology to be well-developed is in sorting and transform the image of fruit which is captured webcam to be a
grading processes [1]. Sorting and grading are important numerical value of HSV color components of every pixel
process to maintain quality of products. In present common covering the entire image that will be used to compute
scenario, sorting and grading of fruit according to maturity analytical data to determine the quality of fruit.
level are performed manually before transportation. This
manual sorting by visual inspection is labor intensive, time III. COLOR SPACE
consuming, and suffers from the problem of inconsistency and
A color space is a method by which we can specify, create,
inaccuracy in judgement by different human [2]. To increase
the accuracy, precision, continuity, and uniformity of sorting and visualize color [8] into unique data representation. It is a
and grading, the development of novel technology is needed definition of color into separated components which construct
[3]. the color. The RGB color space defines specific color into
combinations of Red, Green, and Blue, otherwise the HSV
For small/home agro-industrial companies in Pakistan color space represents specific color into Hue, Saturation, and
which are mostly in micro-business, the procurement of high- Value. All that color representation is used in particular
cost sorting machine for their needs is burdensome, whereas
they need that machine to maintain and increase their product’s

c 2013 IEEE
978-1-4799-1078-6/13/$31.00 § 71
condition according to the need, different color space is better IV. SYSTEM DESCRIPTION
for different applications. Commonly, a color space is
represented as 3-D data representation. A. Mechanical System
The mechanical system is designed in the form of inclined
RGB color space, the color red, green, and blue are and segmented plane to minimize the utilization of high-cost
mapped onto a Cartesian coordinate system which results a 3- conveyor belt. By adopting the concept of LEGO toy building,
D cube. The vertices of cube are the primary colors (red, this mechanical system is designed to be fast and easily
green, and blue) and the secondary colors (cyan, yellow, and mounted and separated. The advantages of using this
magenta) of light. The origin of the coordinate system is black mechanical concept are low power, portable, and easy to
where the red, green, and blue (RGB) color components are all arrange. By using this concept, the system is not only
0.0. The diagonally opposite corner of the cube is white, where upgradable but also customizable according to the user’s needs.
the RGB color components are at their maximum value. It is The mechanical system is designed to be upgradable by adding
the most commonly used color space in computer systems, the additional part and made of thin and light woods so that it
televisions, and videos [9]. The value of RGB in the system can be easy to be brought and transported. The main system
are between 0- 255 to represent minimum value until can be partitioned into two parts.
maximum value.
The camera holder that holds webcam as the main and a
The HSV color space (visualized in Fig.1 right) is unique single sensor used in the system, is placed on the top of
color representation which defines colors according to Hue, analysis-region with slant angle 60° to the bottom so that it is
Saturation, and Value of image. Hue is the basic color type in perpendicular to the analysis-region. The camera holder is
the range of 0-360°, expressed as color hexagon using red made of aluminium and strongly attached to the side of
axis as zero reference. Saturation is the vibrancy of color inclined and segmented plane. The motor servos - ax-12
ranges from 0-100% represented in the V axis. Value is the dynamixels are utilized as the gate opener and director. Those
representation of brightness from 0-100% which is measured motor servos are low-cost and easy to find in the market.
as the distance along the side axis of the cone. The advantage Moreover, the dynamixel is easy to be controlled using serial
of using HSV color space in this project is the effectiveness of communication from usb2dynamixel. For the minimum
system, only 4 dynamixels are used, but it can be added by
basic color determination using Hue component.
additional parts to increase the number of quality. The main
purpose of this mechanical design is to achieve the low-cost,
low-power, and portable mechanical system for sorting and
grading machine so that it can be employed flexibly by the
user e.g. within a room, a moving truck container, a garden,
etc.

72
The method of sorting is based on color quality or
B. Sorting and Grading Mechanism dimension of fruit. The system will provide the choice in color
or dimension mode in the beginning of program so that the user
more flexible to choose which method they need. However, the
data of color and dimension of every fruit analyzed will be
displayed in PC’s monitor over time.

C. Computer Vision Algorithm


visualizes the method of computer vision algorithm done
\\ by the autonomous machine. By grabbing video image from
the camera, the computer vision algorithm crops some Region
of Interest (ROI) within the image. The ROI covers the region
of image which consists of the image of fruit. After take the
ROI, the machine transforms the ROI image from RGB color
space into HSV color space. The data in ROI-HSV is then
processed to do feature extraction. The feature extraction is
performed to segment the fruit image from the background and
take important information data. The data taken from feature
extraction are stored in the memory to be computed by the
computation algorithm. As the result of computation, the
machine controls the servos and displays the parameter data on
PC’s monitor.

Grabbing Image Cropping ROI Feature Extraction

HSV Transform
Computation:
 Interested-Color Percentage
 Fruit Color Defect
 Fruit Size

Command data

Flowchart of System Displaying Data in Servo Control


Manipulated Image
The flowchart of system is described. The autonomous
system is started with system initialization e.g. camera Computer Vision Algorithm
initialization and servo motor initialization. Then the camera
(which covers analysis area and queuing area) will check
analysis area whether a fruit exists or not. If there is not a fruit, V. FEATURE EXTRACTION
the camera will check queuing area. If there is a fruit in
queuing area then the mechanical system will control the motor A. RGB to HSV Transformation
servo to load fruit from queuing area toward analysis area, The origin of image data of C920 is RGB, so that the
otherwise if there is not a fruit, the system enters idle state to system needs to transform RGB to HSV color space. The RGB
wait until user reloads fruits. If a fruit exists on analysis area, to HSV transformation is done by applying the formula of
the system will analyze its quality. The quality analysis RGB-HSV conversion as in (1). The conversion results the data
consists of 1) color quality analysis and 2) dimension of fruit of Hue, Saturation, and Value, which are still in 3-D color
analysis. Both of them will determine fruit quality. Then the space with another representation. To use the only Hue
autonomous system will sort the fruit according to its quality to component from HSV, the algorithm is designed to divide 3-D
specific bin represent fruit’s quality number. array data to be 1-D array data of HSV component. The array
of HSV = {H,S,V} then is divided into HSV{0} = H, HSV{1}
= S, and HSV{2} = V. From now on, the colors of every pixel
in the image are represented as separated HSV component.

73
VI. CALCULATION AND CALIBRATION
B. Natural Ripeness Color Segmentation The calculation of categorized color component percentage
of green, yellow, orange (g, y, o, in N-number) is performed
Segmentation is the technique used to partition the image
into several regions [11] which include important information. by using (2). Then by comparing the composition of
In this project, the segmentation covers the processes of categorized color component, the color decision can be
thresholding and clustering which is used to group and class resulted. The calculation of fruit size is done by applying (3).
the natural color of sorted and graded fruit. According to [10], The K is the constant of calibration resulted in machine
the maturity of fruit can be determined from the distribution of calibration. The distance between camera and the base of
specific color component. By analyzing the fruit’s image queuing and analysis region is 300 mm. So that by
within HSV color space in the range of Hue, the natural implementing spherical area approaches, the value of K can be
ripeness level of fruit can be monitored in the line of Hue determined. In this project, calibration of K is found as 1/102.
number from H = 29° to H = 60° with S=V= 100% for the Every pixel of image are the representation of 1/102 cm or
whole range, as shown in Fig. 5. The emergence of yellow to 0.098 mm. It is very precise measurement than using a ruler or
red component is the signal of maturity. The S and V are still vernier caliper. The calibration is held in a room with light
set in the whole region, whereas they can be used to analyze intensity 200 lux.
another parameter of fruit quality, that is fruit defect. The
darker the color of fruit color, the worse the quality. If the dark
level of color exceed the threshold, the fruit quality is bad
(indication of fruit decay). The value of H is still in degree of
Hue from hexagonal HSV color space. The computer vision
algorithm represents the degree from 0° - 360° into byte
representation from 0 until 180. So that, it can be said that the
characteristic of orange fruit ripeness is the emergence of H
from 15 – 30 in the range of byte value.

74
The fruit samples used in experiment have dimension 40 VIII. CONCLUSION
mm to 75 mm. The color diversity is graded from green to This paper introducing a new design of autonomous fruit
orange. The high quality fruits have characteristics of Hue sorting and grading using computer vision so that it is portable,
color from 60° to 29° or in byte representation 30 - 15 (see Fig. fast, low-cost, and user customizable. The test has been
5) and have upper class diameter > 60 mm. The combination of conducted for orange fruit in the size between 25 mm – 75 mm
color class and diameter class are used to determine fruit and indicates good result in color classification, sizing, and
quality. sorting. The fluctuation of lighting condition does not affect the
precision of system while the light intensity is enough (150-
The calibration of system uses a sample of an orange fruit. 500 lux). For future work, the techniques of sorting can be
First, the orange fruit is measured using vernier caliper and the upgraded to be multiple-analysis using parallel-threading and
second step the fruit diameter analysis algorithm will estimate plural-sliding path to improve the quantity of fruit per time
fruit diameter based on fruit’s bounding box. From the sorting.
measurement using vernier caliper, orange fruit sample had
diameter of 7.3 cm as shown in Fig. 6. Then, by using visual
measurement technique the system estimated fruit diameter. ACKNOWLEDGMENT
The measurement data is sampled every 10 ms along 500 ms of We would want to appreciate and thank all of those people who
total sampling time. Fig. 7 shows the results of sample orange helped us during this journey of completing final year project.
fruit’s diameter estimation. The error of measurement is Without everyone’s support, we could not have accomplished
relatively low with deviation no more than 0.003 cm. our work.
We express our sincere gratitude to Mr. SAEED (Dept. of
Electronics Engineering) for his amazing support and guidance,
VII. RESULT AND DISCUSSION continuous encouragement and supervision throughout the
The experiment data are shown in Table 1. The data are course of the present work. It’s of no doubt that we have been
taken from the first 10 fruit samples after calibration. As shown very fortunate to work under such a supportive and cooperative
in Table 1, the color classification of all fruits are successfully teacher/internal
done (there is no misjudging of fruit color) in the room with And last but not the least we are extremely grateful to the whole
light intensity from 150 – 500 lux. The fluctuating results of faculty and administration of university, for providing us all the
size measurement data are small (below 2%) so that the facilities that were mandatory, without which this project could
calibration is successful and the size measurement results are not be a success.
valid. Overall, the machine works relatively fast with sorting
speed 500 ms (Processor 2.2 GHz, servo serial communication
1Mbps). REFERENCES

 H. A. Eissa and A. a. A. halik, “Understanding Color


Image Processing by Machine Vision for Biological
Materials,” Struct. Funct. Food Eng., pp. 227–274,
2012.
 S. Yogitha and P. Sakthivel, “RESEARCH ARTICLE
A Distributed Computer Machine Vision System for
Automated Inspection and Grading of Fruits,” vol. 3,
no. 4, pp. 522–527, 2014.
 S. Nandi, B. Tudu, and C. Koley, “A Machine Vision-
Based Maturity Prediction System for Sorting of
Harvested Mangoes.,” IEEE Trans. Instrum. Meas., vol.
63, no. 7, pp. 1722–1730, 2014.
 R. Mahendran, “Application of Computer Vision
Technique on Sorting and Grading of Fruits and
Vegetables,” J. Food Process. Technol., pp. 1–7, 2012.
 O. Marques, "Histogram Processing," in Practical
Image and Video Processing Using MATLAB, Florida,
John Wiley, 2011, pp. 176-180
 O. Marques, "Image Segmentation," in Practical Image
and Video Processing Using MATLAB, Florida, John
Wiley, 2011, pp. 365-371
 O. Marques, "Morphological Image Processing," in
Practical Image and Video Processing Using
MATLAB, Florida, John Wiley, 2011, pp. 299-325
 O. Marques, "Feature Extraction And Representation,"
in Practical Image and Video Processing Using
MATLAB, Florida, John Wiley, 2011, pp. 447-466.
 NM Ali, MS Karis, AFZ Abidin, B Bakri, NR Abd
Razif, “Traffic Sign Detection and Recognition:
Review and Analysis”, JurnalTeknologi 77(20), 107-
113, 2015
 NM Ali, YM Mustafah, NKA Md Rashid,
“Performance Analysis of Robust Road Sign
Identification”, IOP Conference Series: Materials
75 Science and Engineering 53(1), 012017, 2013
 NM Ali, MS Karis, J Safei, “ Hidden Nodes of Neural
Network: Useful Application in Traffic Sign Recognition”,
in IEEE Conference on Smart Instrumentation,
Measurement and Applications (ICSIMA), 2014, pp. 1 -4.
 NM Ali, NKA Md Rashid, YM Mustafah, “Performance
Comparison between RGB and HSV Color Segmentations
for Road Sign Detection”, Applied Mechanics and
Materials, 393, pp. 550-555.
 MS Karis, N Hasim, N Mohd Ali, MF Baharom, A
Ahmad, N Abas, MZ Mohamed, Z Mokhtar, “Comparative
Study for Bitumen Containment Strategy using Different
Radar Types for Level Detection”, 2014 2nd
 International Conference on Electronic Design (ICED), pp.
161-166

76

You might also like