Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

A Real Time Based System for Fruit Grading and

Quality Management

Asim Ali Khan Syed Ikram-ur-Rehman Fatima Nazir


Computer and Information System Computer and Information System Computer and Information System
Engineering Engineering Engineering
NED University of Engineering and NED University of Engineering and NED University of Engineering and
Technology Technology Technology
Karachi, Pakistan Karachi, Pakistan Karachi, Pakistan
asimalikhanned21@gmail.com Ikram96211@gmail.com fatimanaxit@gmail.com

Abstract—In Pakistan, the subject market is based on fruits In most fruits, it is observed that the skin color changes with
and vegetables so it’s the concern of dealers or suppliers to ensure the change in maturity level. Therefore, many computer vision
the quality of it before dealing out. For this motive, a Fruit based techniques have been proposed for calculating ripeness
Grading and Quality Management System is needed, in order to using surface color [1]-[3].
resolve the issue of quality. Though, many fruits grading systems
have been instigated but they are exorbitant enough to be bought Also [4], a FPGA based system was used, as it allows the
by small industries. Presently, most farms use manual experts but implementation of image processing algorithms in parallel,
there is still a downside of availability in case of seasonal fruits resulting in reducing the time consumed. The proposed system
along with it, it is inconsistent, time consuming, inaccurate and consists of a mechanical system along with a moderately priced
laborious. In order to resolve these problems, software has been camera for acquisition of image. Image processing techniques
developed on FPGA to allow the implementation of complex and and image classification modules have been used at runtime,
time-consuming image processing in reduced time for real time resulting in predicting the ripeness of the mango.
application. The project is a proof of concepts and prototype
for a complete fruit sorting digital system on FPGA, II. LITERATURE REVIEW
consisting of a conveyor belt mechanism to take the fruit
through different stages, starting from the acquisition of In Pakistan, population has been increasing day by day, so
image to applying different image processing techniques, as the expectations of food products of high quality and safety
resulting in predicting the ripeness of the fruit. standards. Thus, the requirement of developing an accurate,
efficient, less time consuming and reasonable system which can
Keywords—Fruit Grading; Quality Management of Fruit; ensure these standards is highly recommended.
Ripeness of Fruit; As we know that, fruits like mangoes and strawberries are
graded into categories based on several factors like physical
features. Even the local people are getting too selective in
I. INTRODUCTION choosing the right thing to eat, and it’s obvious as it is their right
Some seasonal fruits like strawberries and mangoes are the as well. It is then necessary for the suppliers to ensure the
crush of the market, as their demand is greater than any other distribution of those products which are good and healthy to eat
fruit, when there seasons come. There is no chance of any other and which meet high standards of the market.
fruit, to beat them up in sales. As a result of the study, it has The necessity of supplying good quality food products in
been observed that more than 95.3 tons of mangoes were the market without taking a huge toll of time has now become
exported from Pakistan in 2015 and now over the past couple a challenge. As studied in a survey, almost about 2.8-3 million
of years, it has increased and reached up to 97.9 tons. As tons of fruits and 2.2 million tons of vegetables are being wasted
Pakistan is one of the leading mango exporter of Asia, its during plucking or before or after harvesting process, which is
quality should be the main concern of the related authorities. quite a disadvantage.
During the last decade, it is found that change in maturity
As it is one of the most exported good, it is the responsibility
level is found to be observed by change in shade and color of a
of the supplier to ensure its quality. But unfortunately, they are
fruit’s surface. Therefore, for calculating ripeness using surface
not quite good at it because of the shortage of manual experts.
color, many techniques have been lodged.
Manual experts are responsible for the sorting of the fruit, but
Also, techniques for color image segmentation have been
their availability is an issue. If in any case, the supplier ensures
studied as segmentation is an essential method in
their availability, the process of sorting and grading, is time
accomplishing recognition. Techniques such as histogram-
consuming and laborious. Also, in sorting the fruit the experts
based, region-based or edge-based techniques have been
usually throw a good quality fruit in the basket. The defect
developed for monochrome images and adjusted for color
which has been caused by this step is not recognizable at the
images too. Therefore, the recommendation of using perceptual
moment, but the mango gets usually soft from the side, it had
been thrown.
color spaces such as HSV, HSI, HSL, CIELAB or CIELUV  We have to apply this formula, for converting RGB
have been emerged [5]. image into Grayscale.
Lately, a study for the classification of a mango by the
degree of its skin color being brown was done by Lu and Zheng Grayscale image = (0.3*R) + (0.59*G) + (0.11*B)
[3], they applied Least Square Support Vector Machine (LS-  A= 255 – Grayscale image
SVM) to do this classification. By converting the RGB image
into one of the above mentioned techniques (CIELAB or HSV),  Separating the image now into two parts,
they were able to extract certain characteristics through fractal  One which is less than the value 200, on this
analysis, being finally given as an input to the LS-SVM for we will be applying morphological operation.
classification. This operation is applied for making the white
Currently, most existing fruit quality detecting and grading and black pixels more clear.
systems have the demerit of low efficiency, low speed of
grading, high cost and complexity. Therefore, there is a  While the other, greater than the value 200.
necessity for developing an accurate and efficient fruit grading
system, having the merits of high speed and low cost.  We have to perform AND operation between the output
image and the image which has the value greater than
200.
III. OUR WORK
 Finally, the output image gained after AND operation is
As per name of our project, it is obvious the project consists
in the form of pixels. We have to convert it into frames.
of hardware and software. The software consists of a simulink
model in MATLAB by System Generator while the hardware The workflow in terms of the flowchart is given in
part consists of a mechanical system used to transfer the object figure 1.1.
as in our case the fruit, from one stage to other.

A. Software Development
As we have discussed earlier, the main objective of our
project is to develop a system that is capable of differentiating
between a ripped fruit and a healthy fruit. The primary objective
to achieve this goal was to first study the techniques that are
capable of doing so.
After reading certain articles and research papers about
sorting and grading. MATLAB was preferred over other IDEs
on which we can easily do sorting and grading and then can
download the specified program into Field Programmable Gate
Array or any other circuit such as ARDUINO etc.
We have used Simulink Model Block sets in order to get an
efficient and accurate system. Although we did coding of the
system, but doing it on Simulink, it not only gave us more
accurate results but also we were able to make it in a more
convenient and easy to handle method. As Simulink, does not
require any sort of coding so we are able to develop our system
without writing a single piece of code.
Another merit of using it was that it gave us ease of not
altering the data types while integrating it into Xilinx. Whereas
in MATLAB coding, we had to convert every single line of
code while this conversion.

B. Software Workflow
The workflow consists of the following steps:
 First of all, we developed a model in simulink.
Figure 1.1
 Used Computer Vision Toolbox, in order to read an
image file and separating it into its RGB components. C. Hardware Development
 Converting the image which is in frames to pixels, as The hardware part consists of a conveyor system, tends to
Field Programmable Gate Array only accepts inputs of convey the fruit from location to another location. The steps
images in pixels. involved in the hardware implementation and its working are:
 A variable speed conveyor belt will start running with
a fruit on it.
 On reaching, beneath the camera, the photoelectric
sensor will detect the presence of the fruit beneath it and will
stop the conveyor else the conveyor will continuously be
running in a loop.
 As the conveyor stops, the camera will capture the
image and send it to our software.
 The software will grade the fruit accordingly.
 Based on the results of grading, it initializes a sorting
mechanism consisting of a flapper which is controlled
by ARDUINO/ relays.
 If the software detects any ripeness, the flapper will
change the direction of the fruit and the fruit will be
transferred to a container or a basket.
 There will be another sensor which ensures the fruit
has been sorted, so that the flapper can go to its Figure 1.3
original position.
 In case there is no ripeness, the conveyor will continue
to move on without initializing the flapper.
D. Hardware Workflow
The workflow can be demonstrated by the flowchart in
figure 1.2.

Figure 1.4
The figure 1.4 has clearly shown that the software is
detecting the ripped portion. The white color shows the
ripeness, which can further be taken as a value of zero or one in
order to initialize sorting mechanism.

Figure 1.2 V. REFERENCES


[1] Q. Wang, H. Wang, L. Xie, and Q. Zhang, “Outdoor color rating of sweet
cherries using computer vision,” J. Comp. Electron. Agricult., vol. 87, pp. 113–
120, Sep. 2012.
[2] Y. A. Ohali, “Computer vision based date fruit grading system: Design and
IV. RESULT AND ANALYSIS implementation,” J. King Saud Univ. Comput. Inf. Sci., vol. 23, no. 1, pp. 29–
The results shown after modeling the proposed system on 36, 2011.
[3] H. Zheng and H. Lu, “A least-squares support vector machine (LS-SVM)
Simulink are much more accurate and efficient as can been seen based on fractal analysis and CIELab parameters for the detection of browning
in figure 1.3 and 1.4. It has provided an easy interface for degree on mango (Mangifera indica L.),” J. Comput. Electron. Agricult., vol.
developing such products. 83, pp. 47–51, Apr. 2012.
[4] Nubia Liliana Montes Castrill´on, “Real-time classification of coffee fruits
using FPGA”, Universidad Nacional de Colombia Facultad de Ingenier´ıa y
Arquitectura, Departamento de Ingenier´ıa El´ectrica, Electr´onica y
Computaci´on Manizales, Colombia 2015.
[5] Montes, Nubia: Segmentaci´on de Im´agenes de Frutos de Caf´e en el
Proceso de Beneficio, Universidad Nacional de Colombia, Tesis de Grado,
2003

You might also like