Documente Academic
Documente Profesional
Documente Cultură
by
Siddhika Arunachalam
Harsh H. Kshatriya
Supervisor:
Prof. Dr. Mamta Meena
(Computer Engineering)
AET’s
Atharva College of Engineering
(2018-19)
Index
iii
2018 - 2019
List of Figures
Image Processing is a technique which converts an image into a digital image to obtain some
enhancement or to select some effective information from it. Fruits have many vitamins and
necessary nutrients for the human body. Fruits find its uses in both fresh and processed forms.
In order to have good quality of processed products the quality of fruits should be good. In the
agricultural field, image processing technology is widely used. Identification and Classification
of fruit is a major challenge for the computer vision to achieve near human levels of
recognition. Quality or grading is helped by detection of defects present on fruit surface or peel.
As there is a great demand for high-quality fruits in the market, the task of defect detection in
fruit is very vital in the agricultural industry. Due to large demand, manual monitoring of fruits
is ineffective and defect detection by the human is labour-intensive and time-consuming. The
defect detection system minimizes error and also speeds up the time of processing. The
proposed system uses MATLAB software for detecting defects present on the surface of the
fruit using RGB images. The steps involved are pre-processing, segmentation, edge-detection
and feature extraction to classify the fruit as defected or fresh.
1. Introduction
In image processing, an input image is given and the output of image results into an image or
features of an image. Image processing can be used for different objectives such as image
recognition, recognition of pattern, image sharpening and image retrieval. The main four types
of digital images include a binary image, indexed image, grayscale image and true-colour
image. In processing the digital image, various phases are to be followed in order to extract the
required information from the digital image. The phases of image processing are Pre-
processing, Segmentation, Feature Extraction and Classification [1].
For deciding the overall acceptance quality for customers, the uniformity in size, shape and
other quality parameters of fruits are required. The color of the fruit indicates its maturity and
presence of defects. Labour shortages and lack of overall consistency to the process resulted in
a search for automated solutions. The important aspects for the inspection of fresh fruits are
colour, size and number of defects [2]. The defect or damage usually occurs in fruits due to
various factors such as rotting, scab, fungal growth, post harvesting activities etc. These defects
must be removed in order to prevent cross-contamination and reduce subsequent processing
cost.
1.3 Applications
The proposed system can be used for segregating and classifying the fruits based on
defects.
The system is very easy to use and just requires basic knowledge of image uploading
and different formats used to store images after image acquisition.
Overall cost of the implementation of the system is comparatively low so the system
can be easily maintained.
The system can be used for automated labelling and price computing where costing for
the fruit will depend upon the features extracted [3].
2. Review of literature
In this system an automated tool is introduced, which can be capable of identifying and
classifying mango fruits based on shape, size and color features by digital image analysis.
At the beginning, preprocessing techniques are adopted to obtain the binary image and
morphological operations are performed on the digital images of different mango fruits.
Then, the processed images are classified using a suitable classification method.
Manual computation takes a lot of time and are inaccurate but this system takes less time
with precise result. Based on shape, size, color, and texture of the fruit defected fruits are
identified. The system subtracts the input image with the defect classified image and based
on this fruit quality is revealed. Once the fruit is individualised, the following parameters
are calculated using the information extracted from the boundaries such as: centroid,
maximum and minimum diameter, surface, perimeter and circularity.
This paper presents a hierarchical grading method which is applied to the fruits. In this
paper the identification of good and bad fruits has been focused on the methods using
Matlab. First of all, certain features are extracted from the input fruit image, later different
operations such as thresholding, segmentation, k-means clustering have been performed.
Correlation method is used for feature matching. With the extracted features each value are
correlated with one another and we get a specific value for good and bad fruits, with these
values, identification of good and bad fruits has been performed.
In this paper a used method for the external defect detection of fruit, is, the image is
segmented using various methodologies in Matlab. The first segmentation method used is
K-means clustering. The second method of segmentation which is used is marker-
controlled watershed segmentation. It is based on simulation of the flood. The third method
that is used for segmentation of image is Otsu’s method which is based on thresholding of
clusters. Then edge detection is used which is based on optimization techniques. The fifth
method for image segmentation uses the Gabor filter which involves decomposition of an
input image.
6. “Computer Vision Based Fruit Grading System for Quality Evaluation of Tomato in
Agriculture industry”
Authors: Megha.P.Arakeria, Lakshmanab
In this paper, a system is proposed for quality evaluation of tomato in the agriculture
industry. This system was designed to overcome the drawbacks of manual technique of
fruit sorting. The system mainly consists of two parts: i) Fruit handling ii) Image processing
module. The fruit handling system is used to move the tomato on the conveyer belt and for
the image acquisition. The images of the tomato acquired are analyzed using image
processing techniques to determine whether the tomato is defective or non-defective, and
ripe or unripe.
The proposed system in this paper is to develop a general algorithm to effectively segment
objects in images to facilitate fruit defect detection. For splitting an image, a segmentation
scheme using k-means clustering is used to over-segment the original image because it is
known to give a good segmentation result and time efficiency. Region Adjacency Graph
(RAG) is then used to represent region structure to facilitate the merge procedure where
similar regions are iteratively merged into new homogeneous ones based on minimum
spanning tree algorithm.
This paper presents a novel method to detect surface defects of an apple using RGB images
and apples are graded based on these identified defects. Only outer surface to grade the
apples is considered. The method starts with background removal and region of interest
(ROI) selection using grow-cut method; this is followed by multi-threshold segmentation.
The results of grow-cut and multi-threshold segmentation is fused to detect the defects of
an apple. In order to represent the defected area, we extract color statistical, color texture
features in addition to shape features, which are further used for apple grading. Sequential
Forward Selection algorithm is used for selecting useful discriminant features. Based on
the selected features, we grade the apples into different grades using K-Nearest Neighbor
(K-NN) classifier.
Defect Detection of Fruit and Classification, in the application of image processing, is the task
of accepting a fruit image and then classifying the fruit based on the features extracted. The
term ‘features’ in this context might refer to shape, size, color and number of defects present.
Without the ability to examine the fruit image, the searches must rely on the images provided
by the user [1].
These defect detection systems also depend upon the environment in which the image has been
captured, and storing of fruit images in the dataset. Different techniques such as denoising,
background subtraction, edge detection can be used.
4.1 Aim
Our project aims to develop a fruit defect detection system which will use the concept of image
processing and to classify the fruit from the given dataset. We intend to combine feature
extraction technique and classification for the final output. To do so we are going to convert the
RGB image into binary image during the preprocessing phase and then geometric features such
as area will be calculated and condition will be applied. Though a lot of research has been done
on quality assessment of the fruit, we want to classify the fruit and display the result which
would help in reducing the human time and effort.
4.2 Objectives
1. The objective of our project is to develop an fruit defect detection system which can
accept a fruit image and classify the fruit as defected or fresh after evaluation of some
intermediate phases.
2. Mathematical computations and storage of quality data would help in reducing the time.
3. The system will classify the fruit and the result will be made available to the user
through the graphical user interface. The dataset of fruit images will be maintained in
the folder with each image having a unique number.
4. Our final result will be a Matlab based software with a provided dataset, which utilizes
the color and size features for making the decision of classification.
5. Problem Statement
To enhance the quality and quantity of the agricultural product, there is a need to adopt the new
technology. Pear classification requires early and cost effective solutions. Image processing
approach is a non-invasive technique which provides consistent, less time consuming solution
to farmers for managing the use of pesticides and fertilizers. In a place where bulk of fruits are
to be analyzed as per their quality and shape features, testing each fruit manually and classifying
it as defected or fresh is a time-consuming task.
The data in the form of an image is not only difficult to store as it takes a lot more space than
other type of data, but to filter the image and retrieve the information according to the content
required takes a lot of time and human effort. We need a system that optimizes this process
and the output of the system should be more than binary. These problems lead to the
development of an automated system which is capable for classification of fruits encompassing
image processing techniques.
6. Proposed System
The proposed system finds its uses in a variety of domains. Initially the user is asked to upload
the fruit image from the provided dataset with the help of a GUI. The acquired image will be
an RGB image. This RGB image is preprocessed in which it is converted to grayscale image
and then to binary image by thresholding using a suitable threshold value. The noise present in
the image is removed by filtering with the help of a median filter. Then, background subtraction
is performed for extracting the foreground object which helps in reducing the amount of data
to be processed. The defected fruit is identified by extracting the contour of the damaged part.
Then the damaged part has been filled to find its area in the image as the basis for judgement.
The ratio will be calculated and will be checked with a set threshold value. If the ratio is greater
than the set threshold value then the fruit is defected otherwise, the fruit is fresh. The block
diagram of the proposed system has been attached below for proper understanding of the
process.
This describes the functional requirements of the system for those requirements which are
expressed. Functional requirements may be calculations, technical details, data manipulation
and processing and other specific functionality that define what a system is supposed to
accomplish. Our application first accepts the fruit image which is uploaded, then it converts the
image into digital image which is suitable for edge detection. In edge detection creation of
boundary for contours is done on the filtered fruit image. Then, the defective parts are filled
with white pixels and the area of fruit in the binary image is calculated. The ratio of area and
pixel value of the whole image will be checked with a threshold value. If greater, display
defected, else, display fresh.
Non-functional requirements are those that do not directly affect the functioning of the system
but affect, the performances of the system. Non-functional requirements are those requirements,
such as, detail constraints, control mechanisms. For example, response time of the system.
Service level requirements are quality of service that is being measured. The quality of service,
is determined by, how efficiently the fruit images are classified. Non-functional requirements
may deal with the entire system as one whole system or deal with a single functional
requirement. Identification of realistic, measurable target values for each service level, is one
more non-functional requirement.
8.1 Scope
● The current work is based on the ratio calculated, in future, more advanced computer
vision techniques can be integrated with artificial intelligence and defect detection
system, in which the prediction of fruits maturity and ripeness can be done, where the
system would learn from its mistakes and analyze the situation in a better manner,
reducing even more time.
● With the introduction of artificial intelligence, the size of dataset can be increased where
the fruits will be categorized as, in maturity phase, fresh or ripe.
● The current system can be extended forward to calculate perimeter, roundness, and
percent defect feature to enhance the accuracy of the algorithm. The roundness and
percent defect can be used to identify whether the fruit’s quality is export or reject.
8.2 Feasibility
8.2.1 Operational Feasibility
Operational Feasibility is the ability to utilize, support and perform the necessary tasks of a
system such as storing of images, feature extraction and classifying the fruit based upon the
features extracted. It includes everyone, from who creates, operates or uses the system. To be
operationally feasible, the system must fulfill a need required by the business.
9. Design Details
A data flow diagram (DFD) maps out the flow of information for any process or system. It
uses defined symbols like rectangles, circles and arrows, plus short text labels, to show data
inputs, outputs, storage points and the routes between each destination. Data flowcharts can
range from simple, even hand-drawn process overviews, to in-depth, multi-level DFDs that
dig progressively deeper into how the data is handled. They can be used to analyze an existing
system or model a new one.
In the sequence diagram, the objects according to their time of execution are listed below. The
sequence diagram deals with how the user will flow through the system sequentially and what
are the processes that will take place. The objects interact with each other by sending messages
to each other. As shown in the figure, the user first uploads the fruit image and then the defect
detection system will perform different operations on the fruit image and classify the fruit. The
result will be made available to the user.
9. 4 E-R Diagram
The main entities and how they are related with the other is shown in the diagram below. The
entities and their key attributes are defined and what entities are interacting with each other for
what purposes. There will be a dataset in which the collection of fruit images will be present
and each fruit image will be given a unique number and this unique number will act as a primary
key. Therefore, the fruit becomes a strong entity. The user selects a fruit and gives it to the
defect detection system, the system will inspect the fruit for classifying it as defected or fresh.
Gantt Chart
10-Jul 20-Jul 30-Jul 9-Aug 19-Aug 29-Aug 8-Sep 18-Sep 28-Sep
Requirement Gathering
Analysis
IEEE Paper Survey
Abstract
Presentation 1
Literature Survey
Analysis of Methods
Flow of Project
Modelling
Presentation 2
Project Synopsis
● RGB to Grayscale conversion: The captured image has three matrices of sizes with
respect to the format used to store the images (TIFF, JPEG, BMP, etc). The three
matrices indicate that how much of the three colours red, green, and blue a certain pixel
should use. This RGB image is converted to a grayscale image, in which the pixels have
one colour which is a shade of grey in various ranges in between.
● Filtering: The binary image (digital image) is then filtered using a median filter which
reduces noise and improves the visual quality of the image. Filtering is also referred to
as smoothing. Value of a pixel gets replaced by the median of the grey levels in the
neighborhood of that pixel. It is used for the detection of edges.
3) Feature Extraction: The area(a) of Pear in the binary image is calculated which is the
number of pixels in the white area total. Then, the total is divided by the pixel value (x*y)
of the whole image, by which the area of the Pear relative to the image can be obtained.
4) Classification of the fruit: After feature extraction, the defect detection is performed based
on surface defect (such as scars, spots, etc). The defected fruit is identified by creating a
boundary of contours (defective part) on filtered fruit image and the contours are filled with
white pixels to finds its area for the basis of judgement. After which the condition will be
applied. If the ratio is greater than the set threshold value then the fruit is defected otherwise,
the fruit is fresh.
12. Conclusion
Due to the increasing demand for quality fruits, a reliable mechanism to handle the bulk of data
is implemented. Algorithms were developed to classify the Pear fruit, based on a single view
of fruit images. The Pear fruits were differentiated into two classes based on the ratio
computed. We propose a system that is efficient and effective in the field of image processing,
which will make life easier and faster.
Hence, using the proposed algorithm, sorting of Pear fruits can be done based on quality. The
system will have a good prospect of application in fruit size detecting and grading areas. Some
other features such as display of diseases of fruit and analysis of statistical comparison of
defects in various fruit can be implemented in addition to the proposed algorithm. Thus, making
the process easier and faster.
13. Acknowledgement
We would like to thank our project guide Prof. Mamta Meena for her enormous cooperation and
guidance. We have no words to express our gratitude for a person who wholeheartedly supported
the project and gave freely of her valuable time while making this project. All the inputs given by
her found a place in the project. The technical guidance provided by her was more than useful and
made this a success. She has always been a source of inspiration for us. It was a great experience
learning under such a highly innovative, enthusiastic and hard working professor. We are also
thankful to our principal Dr. S.P. Kallurkar, and HOD of Computer Department, Prof. Mahendra
Patil, project coordinator Prof. Deepali Maste, and all the staff members of the Computer
Department who have provided us various facilities and guided us throughout to develop this project
idea. Finally, we would like to thank teachers of the college and friends who guided and helped us
while we worked on this project idea.
15. Appendix