SlideShare a Scribd company logo
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 
_______________________________________________________________________________________ 
Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 92 
THE QUALITY IDENTIFICATION OF FRUITS IN IMAGE PROCESSING USING MATLAB Alok Mishra1, Pallavi Asthana2, Pooja Khanna3 1Department of Computer Science & Engg, Ambalika Institute of Management & Technology, Lucknow 2Department of Electronics & Communication, Amity University, Lucknow 3Department of Computer Science & Engg, Amity University, Lucknow Abstract The ability to identify the fruits based on quality in the food industry which is the most important technology in the realization of automatic fruit sorting machine in order to reduce the work of human and also time consuming. This work presents a hierarchical grading method applied to the Fruits. In this work the identification of good and bad Fruits is focused on the methods using MATLAB. First we extract certain features from t he input fruit image, later using different method like thresholding, segmentation, k-means clustering and thus we get related databases. Comparing several trained databases, we get a specific range for the good and bad fruits. From the proposed range we can identify the good and bad fruits. Thus this paper analysis the good and bad fruits with a very high accuracy successfully using image processing. Keywords: Image Acquisition, Pre-processing, Segmentation, feature extraction, feature training, feature matching. 
------------------------------------------------------------------***-------------------------------------------------------------------- 1. INTRODUCTION Fruit is grown as it has many vitamins and necessary nutrients for human bodies. Fruits, commonly consumed in daily diets, are a major source of anti-oxidants (sgherri et al.,2008). There are a seasonal fruits and their availability is limited during certain seasons (Rodriguez-Lafuente et al.,2010).Fruits find numerous uses in both fresh and processed forms. Processed forms include jam, paste and juice. Export of these processed products of fruits yield more income for the country. In order to get good quality of processed products the quality of fruits should be good. Identifying good and bad quality fruits in industries manually is the main obstacle as it is time consuming and for high labour cost. Therefore it is very important to identify the quality of fruits for the purpose of its usage by an automatic sorting machine for various necessities in industries. To overcome this problem, image processing method in industries has become a major issue in recent years. Using MATLAB software as a tool in image processing, we can find the quality of Fruits using various algorithms. Finally after collecting lot of trained data bases, we have proposed certain range. With these ranges we can identify the quality of Fruits, whether it is good or bad. 2. PROPOSED METHODOLOGY The stages in the proposed methodology are shown below. 
The steps involved in identification of good and bad quality of Fruits are image acquisition, pre-processing, segmentation, feature extraction, feature training and Feature matching. Finally the quality of fruit is identified. 3. IMAGE ACQUISITION 
An image is analyzed as it is clicked. Then the user is given tools to discard that he considers noise. The image acquisition is done using a digital camera and it is loaded and saved using MIL software. MIL works with images captured from any type of colour (RGB) or monochrome source(Gray) . MIL supports the saving and loading of images. It supports file formats such as TIF (TIFF), JPG (JPEG), BMP (bitmap), as well as raw format. Here the input image got is an RGB image. 4. PRE –PROCESSING 
Basically the images which are obtained during image acquisition may not be directly suitable for identification and classification purposes because of some factors, such as noise, weather conditions, and poor resolution of an
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 
_______________________________________________________________________________________ 
Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 93 
images and unwanted background etc.We tried to adopt the established techniques and study their performances. The steps involved in pre-processing are A. Input image B. Background subtraction C. Converting RGB to gray D. Converting gray to binary E. Filtering All the steps mentioned above is easily and efficiently done by using basic commands MATLAB toolbox. 4.1 RGB Image RGB is one of the formats of colour images. Here the input image is represented with three matrices of sizes regarding the image format. The three matrices in each image corresponds to the colours red, green and blue and also says that of how much of each of these colours a certain pixel should use. 4.2 Background Subtraction Background subtraction is a process of extracting foreground objects in a particular scene of a image. A foreground object is defined as an object of attention which helps in reducing the amount of data to be processed. 4.3 Gray Image Gray scale images have one colour which is a shade of gray in various ranges in between. Monochrome image is another name of gray image. This denotes the presence of only one (mono) colour (chrome). To convert any colour image to a gray scale representation of its luminance, we must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. 4.4 Binary Image A Binary Image is a digital image which has two assigned pixel values. Typically the two colors used for a binary image are black and white. The gray image of Fruits is converted to binary image this means that each pixel is stored as a single bit (0 or 1). Binary images used in digital image processing as masks or as the result of some frequent operations such as segmentation, thresholding, and dithering. 4.5 Filtering The purpose of filtering is to smooth the image. This is done to reduce noise and improve the visual quality of the image. Often, smoothing is referred to as filtering. Here filtering is carried out by median filter since it is very useful in detecting edges. 4.6 Median Filter The best known order-statistics filter is the median filter, which replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel 
The original value of the pixel is included in the computation of the median. Median filters are quite popular because, for certain types of random noise they provide excellent noise reduction capabilities, with considerably less blurring than linear smoothing filters of similar size. The median value is not affected by the actual value of the noise cells. The Median filter is particularly good at removing isolated random noise, as in this example[4][5][6]. It also preserves edges and line features better than the Low Pass / Average filter, but does produce some blurring. 5. SEGMENTATION The purpose of image segmentation is to divide an image into meaningful regions with respect to a particular application. The segmentation is based on measurements taken from the image, may be grey level, colour, texture, depth or motion .Here edge-based segmentation is properly suitable .As edge detection is a fundamental step in image processing, it is necessary to point out the true edges to get the best results from the matching process. That is why it is important to choose edge detectors that fit best to the application. In this way canny edge detector is chosen. 5.1 Canny Edge Detector: Canny edge detection algorithm is also known as the optimal edge detector. Canny's intentions were to enhance the many edge detectors in the image. 1) The first criterion should have low error rate and filter out unwanted information while the useful information preserve. 2) The second criterion is to keep the lower variation as possible between the Original image and the processed image. 3) Third criterion removes multiple responses to an edge. Based on these criteria, the canny edge detector first smoothes the image to eliminate noise It then finds the image gradient to highlight regions with high spatial derivatives. The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum using non-maximum suppression. The gradient array is now further reduced by hysteresis to remove streaking and thinning the edge.[7]. Here fig1.6 shows the edge detection of good and bad Fruits using canny edge detector. 6. FEATURE EXTRACTION 
Feature extraction is defined as grouping the input data objects into a set of features. The features extracted carefully will help to extract the relevant information from the input data in order to perform the feature matching .Using this we can reduce the representation input size
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 
_______________________________________________________________________________________ 
Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 94 
instead of the full size input. Here clustering process has been used to extract features form good and bad fruits. 6.1 Clustering Basics Clustering is the processes of grouping together similar objects. The resulting groups are called clusters. Clustering algorithms group objects according to various criteria. Unlike most classification methods, clustering handles data that has no labels, or ignores the labels while clustering. Here fig 1.7 shows the clustering values of good and bad Fruits. 6.2 Clustering Algorithm: K-Means Clustering Algorithm STEP1: The training vectors are grouped into M clusters based on the distance between the code vectors and the training vectors using the below equation (1) and (2). dy= |풙풊−풚풊|풌풋 =ퟏ -------------1 Where dy is the distance between the training vector Xi and the code vector Yi . 푆푢푚푖푗 = 푋푖푗 --------------2 Where, c is the cluster strength STEP2: Compute the sum vector for every cluster by adding the corresponding components of all the training vectors that belong to the same cluster using the equation (3). 퐶푒푛푡푟표푖푑 = 푆푢푚푖푗 /푛푖 Where i=1, 2….n) STEP3: Compute the centroid for each cluster by dividing the Individual components of the sum vector by the cluster Strength in using the equation (3). STEP4: Replace the existing code vector with the new centroid to form the revised codebook. STEP5: Repeat the steps 1 through 4 till the codebooks of the consecutive iterations converge[8] 7. FEATURE TRAINING 
Feature training method includes collection of large number of trained features of clustered values of good and bad fruits. More number of collecting trained features gives more accuracy. In this method, the number of closest code vectors for each training vector is identified and is stored as the corresponding cluster density. The cluster densities for all training vectors are computed and are sorted in descending order. From the sorted list, the top M training vectors with higher cluster densities are identified and grouped as codebook. This codebook is saved and loaded in MATLAB for feature matching. 
8. FEATURE MATCHING Feature matching methods essentially consist of identifying features in images that can be matched with corresponding features in the other images from which a transformation model can be estimated. Feature matching is an important task in the area of image processing Here correlation method is used for feature matching.. Here the clustered values of good and bad fruits are taken more in number. With the extracted features each value are correlated with one another and we get a specific value for good and bad fruit. With these values we can identify good and bad Fruits. 9. CONCLUSIONS In this paper the identification of good and bad fruits based on quality in image processing using MATLAB is successfully done with 80% accuracy. The use of image processing for identifying the quality can be applied not only to any particular fruit. We can also apply this method to identify quality of vegetables with more accuracy. Thus, this will enable the technology to be applied in many products. REFERENCES [1]. A. K. Jain, “Fundamentals of Digital Image Processing” Prentice Hall of India, First Edition,1989. [2]. Rafael C.Gonzalez and Richard E. woods, “Digital Image Processing”, Pearson Education, Second Edition,2005. [3]. Delores M.Etter,”Introduction to Matlab”,2010. [4]. R. Yang, L. Lin, M. Gabbouj, J. Astola, and Y.Neuvo, “Optimal Weighted Median Filters Under Structural Constraints,” IEEE Trans.Signal Processing, Vol. 43, PP. 591-604, Mar 1995 . [5]. Pei-Eng Ng and Kai-Kuang Ma, “A Switching Median Filter with BDND for Extremely Corrupted Images”, IEEE Trans Image Processing, Vol. 15, No. 6, PP. 1506-1516 June 2006. [6]. Gajanand Gupta ,’’Algorithm for Image Processing Using Improved Median Filter and Comparison of Mean, Median and Improved Median Filter”, International Journal of Soft Computing and Engineering(IJSCE)ISSN:2231- 2307,volume-1,Issue-5,November 2011. [7]. Sonam Saluja et al.,” A Study of Edge-Detection Methods”, International Journal of Advanced Research in Computer and Communication EngineeringVol. 2, Issue 1, January 2013. [8]. Ms.Chinki Chandhok et al.,” An Approach to Image Segmentation using K-means Clustering Algorithm”, International Journal of Information Technology (IJIT), Volume – 1, Issue – 1, August 2012.
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 
_______________________________________________________________________________________ 
Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 95 
[9]. Gastelum-Barrios et al.,” Fruit quality evaluation with image processing: A review”, African Journal of agriculture Research vol.6(14),pp.3333-3339,18 july,2011 . [10]. Arman Arefi et al.,”Recognition and localization of ripen fruit based on machine vision”, Australian Journal of Crop Science,Ajcs 5 (10):1144-1149 (2010).

More Related Content

PPTX
Touchless Touchscreen
PPTX
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
PPTX
Atm using fingerprint
PPTX
Digital image processing
PPTX
5 pen-pc-technology complete ppt
PPT
Ppt presentation
PPTX
E ball technology
PDF
Line Follower Robot
Touchless Touchscreen
HEALTH MONITORING SYSTEM using mbed NXP LPC11U24
Atm using fingerprint
Digital image processing
5 pen-pc-technology complete ppt
Ppt presentation
E ball technology
Line Follower Robot

What's hot (20)

PPTX
Space mouse
PDF
Electronic Paper (e-Paper)
DOCX
Rainbow Technology Seminar Report
PPTX
Graphics pipelining
PPTX
Rainbow Storage Technology
PPTX
8K Extremely High Resolution Camera System
PPTX
E ball technology ppt
PPTX
e ball presentation
PPTX
Smart Lighting Using IOT
PPTX
PATIENT HEALTH MONITORING SYSTEM
PPTX
Sixth Sense Technology
PPTX
5 pen pc technology by divya
PPTX
Palm vein technology
PDF
The future of 3D printing
PPT
Digital image processing ppt
PPTX
Wireless human health Monitor
PPTX
Iot based garbage monitoring system
PDF
Electronic skin
PPT
E-PAPER TECHNOLOGY
DOCX
Bluetooth Controlled Robot
Space mouse
Electronic Paper (e-Paper)
Rainbow Technology Seminar Report
Graphics pipelining
Rainbow Storage Technology
8K Extremely High Resolution Camera System
E ball technology ppt
e ball presentation
Smart Lighting Using IOT
PATIENT HEALTH MONITORING SYSTEM
Sixth Sense Technology
5 pen pc technology by divya
Palm vein technology
The future of 3D printing
Digital image processing ppt
Wireless human health Monitor
Iot based garbage monitoring system
Electronic skin
E-PAPER TECHNOLOGY
Bluetooth Controlled Robot
Ad

Viewers also liked (20)

PPTX
Image Processing Using MATLAB
PPT
Image quality in nuclear medicine
PDF
The heating pattern of the microwave dehydrator for treating petroleum crude ...
PDF
Measuring effort for modifying software package as
PDF
Generalized fryze control strategy for shunt and
PDF
Comparative analysis of edge based and region based active contour using leve...
PDF
A hydration study by xrdrietveld analysis of cement regenerated from complete...
PDF
Study on transmission energy losses and finding the hazards using what if ana...
PDF
Stabilizationsolidification of iron ore mine tailings
PDF
Simulation of collision avoidance by navigation
PDF
Directly coupled microstrip array antennas for wideband application
PDF
Evaluate the effective resource management through pert analysis
PDF
On approximate bounds of zeros of polynomials within
PDF
The growth of hsr networks around the world
PDF
Influence of carbon sources on α amylase production by brevibacillus sp. unde...
PDF
Design and implementation of microstrip antenna for
PDF
History of gasoline direct compression ignition (gdci)
PDF
Occupational health and safety management system
PDF
Applications of dampers for vibration control of
PDF
A short review on microemulsion and its application in extraction of vegetabl...
Image Processing Using MATLAB
Image quality in nuclear medicine
The heating pattern of the microwave dehydrator for treating petroleum crude ...
Measuring effort for modifying software package as
Generalized fryze control strategy for shunt and
Comparative analysis of edge based and region based active contour using leve...
A hydration study by xrdrietveld analysis of cement regenerated from complete...
Study on transmission energy losses and finding the hazards using what if ana...
Stabilizationsolidification of iron ore mine tailings
Simulation of collision avoidance by navigation
Directly coupled microstrip array antennas for wideband application
Evaluate the effective resource management through pert analysis
On approximate bounds of zeros of polynomials within
The growth of hsr networks around the world
Influence of carbon sources on α amylase production by brevibacillus sp. unde...
Design and implementation of microstrip antenna for
History of gasoline direct compression ignition (gdci)
Occupational health and safety management system
Applications of dampers for vibration control of
A short review on microemulsion and its application in extraction of vegetabl...
Ad

Similar to The quality identification of fruits in image processing using matlab (20)

PDF
IRJET- Identify Quality Index of the Fruit Vegetable by Non Destructive or wi...
PDF
IRJET- Analysis of Plant Diseases using Image Processing Method
PDF
Lung Cancer Detection using Image Processing Techniques
PDF
IRJET- Nail based Disease Analysis at Earlier Stage using Median Filter i...
PDF
IRJET- Nail based Disease Analysis at Earlier Stage using Median Filter in Im...
PDF
Image Processing Algorithm for Fruit Identification
PDF
Computerized spoiled tomato detection
PDF
Computerized spoiled tomato detection
PDF
A study to improve the quality of image enhancement
PDF
IRJET- Comparative Study of Artificial Neural Networks and Convolutional N...
PDF
IRJET- Kidney Stone Classification using Deep Neural Networks and Facilitatin...
PDF
IRJET- Kidney Stone Classification using Deep Neural Networks and Facilitatin...
PDF
IRJET- A Fruit Quality Inspection Sytem using Faster Region Convolutional...
PDF
IRJET - Change Detection in Satellite Images using Convolutional Neural N...
PDF
IRJET- Analysing Wound Area Measurement using Android App
PDF
Brain tumor pattern recognition using correlation filter
PDF
IRJET - Disease Detection in Plant using Machine Learning
PDF
IRJET - Effective Workflow for High-Performance Recognition of Fruits using M...
PDF
IRJET - Plant Leaf Disease Detection and Automated Medicine using IoT
PDF
Intensity Enhancement in Gray Level Images using HSV Color Coding Technique
IRJET- Identify Quality Index of the Fruit Vegetable by Non Destructive or wi...
IRJET- Analysis of Plant Diseases using Image Processing Method
Lung Cancer Detection using Image Processing Techniques
IRJET- Nail based Disease Analysis at Earlier Stage using Median Filter i...
IRJET- Nail based Disease Analysis at Earlier Stage using Median Filter in Im...
Image Processing Algorithm for Fruit Identification
Computerized spoiled tomato detection
Computerized spoiled tomato detection
A study to improve the quality of image enhancement
IRJET- Comparative Study of Artificial Neural Networks and Convolutional N...
IRJET- Kidney Stone Classification using Deep Neural Networks and Facilitatin...
IRJET- Kidney Stone Classification using Deep Neural Networks and Facilitatin...
IRJET- A Fruit Quality Inspection Sytem using Faster Region Convolutional...
IRJET - Change Detection in Satellite Images using Convolutional Neural N...
IRJET- Analysing Wound Area Measurement using Android App
Brain tumor pattern recognition using correlation filter
IRJET - Disease Detection in Plant using Machine Learning
IRJET - Effective Workflow for High-Performance Recognition of Fruits using M...
IRJET - Plant Leaf Disease Detection and Automated Medicine using IoT
Intensity Enhancement in Gray Level Images using HSV Color Coding Technique

More from eSAT Publishing House (20)

PDF
Likely impacts of hudhud on the environment of visakhapatnam
PDF
Impact of flood disaster in a drought prone area – case study of alampur vill...
PDF
Hudhud cyclone – a severe disaster in visakhapatnam
PDF
Groundwater investigation using geophysical methods a case study of pydibhim...
PDF
Flood related disasters concerned to urban flooding in bangalore, india
PDF
Enhancing post disaster recovery by optimal infrastructure capacity building
PDF
Effect of lintel and lintel band on the global performance of reinforced conc...
PDF
Wind damage to trees in the gitam university campus at visakhapatnam by cyclo...
PDF
Wind damage to buildings, infrastrucuture and landscape elements along the be...
PDF
Shear strength of rc deep beam panels – a review
PDF
Role of voluntary teams of professional engineers in dissater management – ex...
PDF
Risk analysis and environmental hazard management
PDF
Review study on performance of seismically tested repaired shear walls
PDF
Monitoring and assessment of air quality with reference to dust particles (pm...
PDF
Low cost wireless sensor networks and smartphone applications for disaster ma...
PDF
Coastal zones – seismic vulnerability an analysis from east coast of india
PDF
Can fracture mechanics predict damage due disaster of structures
PDF
Assessment of seismic susceptibility of rc buildings
PDF
A geophysical insight of earthquake occurred on 21 st may 2014 off paradip, b...
PDF
Effect of hudhud cyclone on the development of visakhapatnam as smart and gre...
Likely impacts of hudhud on the environment of visakhapatnam
Impact of flood disaster in a drought prone area – case study of alampur vill...
Hudhud cyclone – a severe disaster in visakhapatnam
Groundwater investigation using geophysical methods a case study of pydibhim...
Flood related disasters concerned to urban flooding in bangalore, india
Enhancing post disaster recovery by optimal infrastructure capacity building
Effect of lintel and lintel band on the global performance of reinforced conc...
Wind damage to trees in the gitam university campus at visakhapatnam by cyclo...
Wind damage to buildings, infrastrucuture and landscape elements along the be...
Shear strength of rc deep beam panels – a review
Role of voluntary teams of professional engineers in dissater management – ex...
Risk analysis and environmental hazard management
Review study on performance of seismically tested repaired shear walls
Monitoring and assessment of air quality with reference to dust particles (pm...
Low cost wireless sensor networks and smartphone applications for disaster ma...
Coastal zones – seismic vulnerability an analysis from east coast of india
Can fracture mechanics predict damage due disaster of structures
Assessment of seismic susceptibility of rc buildings
A geophysical insight of earthquake occurred on 21 st may 2014 off paradip, b...
Effect of hudhud cyclone on the development of visakhapatnam as smart and gre...

Recently uploaded (20)

PPTX
Geodesy 1.pptx...............................................
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Current and future trends in Computer Vision.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPT
Project quality management in manufacturing
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Geodesy 1.pptx...............................................
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Internet of Things (IOT) - A guide to understanding
Model Code of Practice - Construction Work - 21102022 .pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Current and future trends in Computer Vision.pptx
Mechanical Engineering MATERIALS Selection
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
R24 SURVEYING LAB MANUAL for civil enggi
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CH1 Production IntroductoryConcepts.pptx
Digital Logic Computer Design lecture notes
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Project quality management in manufacturing
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CYBER-CRIMES AND SECURITY A guide to understanding
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks

The quality identification of fruits in image processing using matlab

  • 1. IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 _______________________________________________________________________________________ Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 92 THE QUALITY IDENTIFICATION OF FRUITS IN IMAGE PROCESSING USING MATLAB Alok Mishra1, Pallavi Asthana2, Pooja Khanna3 1Department of Computer Science & Engg, Ambalika Institute of Management & Technology, Lucknow 2Department of Electronics & Communication, Amity University, Lucknow 3Department of Computer Science & Engg, Amity University, Lucknow Abstract The ability to identify the fruits based on quality in the food industry which is the most important technology in the realization of automatic fruit sorting machine in order to reduce the work of human and also time consuming. This work presents a hierarchical grading method applied to the Fruits. In this work the identification of good and bad Fruits is focused on the methods using MATLAB. First we extract certain features from t he input fruit image, later using different method like thresholding, segmentation, k-means clustering and thus we get related databases. Comparing several trained databases, we get a specific range for the good and bad fruits. From the proposed range we can identify the good and bad fruits. Thus this paper analysis the good and bad fruits with a very high accuracy successfully using image processing. Keywords: Image Acquisition, Pre-processing, Segmentation, feature extraction, feature training, feature matching. ------------------------------------------------------------------***-------------------------------------------------------------------- 1. INTRODUCTION Fruit is grown as it has many vitamins and necessary nutrients for human bodies. Fruits, commonly consumed in daily diets, are a major source of anti-oxidants (sgherri et al.,2008). There are a seasonal fruits and their availability is limited during certain seasons (Rodriguez-Lafuente et al.,2010).Fruits find numerous uses in both fresh and processed forms. Processed forms include jam, paste and juice. Export of these processed products of fruits yield more income for the country. In order to get good quality of processed products the quality of fruits should be good. Identifying good and bad quality fruits in industries manually is the main obstacle as it is time consuming and for high labour cost. Therefore it is very important to identify the quality of fruits for the purpose of its usage by an automatic sorting machine for various necessities in industries. To overcome this problem, image processing method in industries has become a major issue in recent years. Using MATLAB software as a tool in image processing, we can find the quality of Fruits using various algorithms. Finally after collecting lot of trained data bases, we have proposed certain range. With these ranges we can identify the quality of Fruits, whether it is good or bad. 2. PROPOSED METHODOLOGY The stages in the proposed methodology are shown below. The steps involved in identification of good and bad quality of Fruits are image acquisition, pre-processing, segmentation, feature extraction, feature training and Feature matching. Finally the quality of fruit is identified. 3. IMAGE ACQUISITION An image is analyzed as it is clicked. Then the user is given tools to discard that he considers noise. The image acquisition is done using a digital camera and it is loaded and saved using MIL software. MIL works with images captured from any type of colour (RGB) or monochrome source(Gray) . MIL supports the saving and loading of images. It supports file formats such as TIF (TIFF), JPG (JPEG), BMP (bitmap), as well as raw format. Here the input image got is an RGB image. 4. PRE –PROCESSING Basically the images which are obtained during image acquisition may not be directly suitable for identification and classification purposes because of some factors, such as noise, weather conditions, and poor resolution of an
  • 2. IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 _______________________________________________________________________________________ Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 93 images and unwanted background etc.We tried to adopt the established techniques and study their performances. The steps involved in pre-processing are A. Input image B. Background subtraction C. Converting RGB to gray D. Converting gray to binary E. Filtering All the steps mentioned above is easily and efficiently done by using basic commands MATLAB toolbox. 4.1 RGB Image RGB is one of the formats of colour images. Here the input image is represented with three matrices of sizes regarding the image format. The three matrices in each image corresponds to the colours red, green and blue and also says that of how much of each of these colours a certain pixel should use. 4.2 Background Subtraction Background subtraction is a process of extracting foreground objects in a particular scene of a image. A foreground object is defined as an object of attention which helps in reducing the amount of data to be processed. 4.3 Gray Image Gray scale images have one colour which is a shade of gray in various ranges in between. Monochrome image is another name of gray image. This denotes the presence of only one (mono) colour (chrome). To convert any colour image to a gray scale representation of its luminance, we must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. 4.4 Binary Image A Binary Image is a digital image which has two assigned pixel values. Typically the two colors used for a binary image are black and white. The gray image of Fruits is converted to binary image this means that each pixel is stored as a single bit (0 or 1). Binary images used in digital image processing as masks or as the result of some frequent operations such as segmentation, thresholding, and dithering. 4.5 Filtering The purpose of filtering is to smooth the image. This is done to reduce noise and improve the visual quality of the image. Often, smoothing is referred to as filtering. Here filtering is carried out by median filter since it is very useful in detecting edges. 4.6 Median Filter The best known order-statistics filter is the median filter, which replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel The original value of the pixel is included in the computation of the median. Median filters are quite popular because, for certain types of random noise they provide excellent noise reduction capabilities, with considerably less blurring than linear smoothing filters of similar size. The median value is not affected by the actual value of the noise cells. The Median filter is particularly good at removing isolated random noise, as in this example[4][5][6]. It also preserves edges and line features better than the Low Pass / Average filter, but does produce some blurring. 5. SEGMENTATION The purpose of image segmentation is to divide an image into meaningful regions with respect to a particular application. The segmentation is based on measurements taken from the image, may be grey level, colour, texture, depth or motion .Here edge-based segmentation is properly suitable .As edge detection is a fundamental step in image processing, it is necessary to point out the true edges to get the best results from the matching process. That is why it is important to choose edge detectors that fit best to the application. In this way canny edge detector is chosen. 5.1 Canny Edge Detector: Canny edge detection algorithm is also known as the optimal edge detector. Canny's intentions were to enhance the many edge detectors in the image. 1) The first criterion should have low error rate and filter out unwanted information while the useful information preserve. 2) The second criterion is to keep the lower variation as possible between the Original image and the processed image. 3) Third criterion removes multiple responses to an edge. Based on these criteria, the canny edge detector first smoothes the image to eliminate noise It then finds the image gradient to highlight regions with high spatial derivatives. The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum using non-maximum suppression. The gradient array is now further reduced by hysteresis to remove streaking and thinning the edge.[7]. Here fig1.6 shows the edge detection of good and bad Fruits using canny edge detector. 6. FEATURE EXTRACTION Feature extraction is defined as grouping the input data objects into a set of features. The features extracted carefully will help to extract the relevant information from the input data in order to perform the feature matching .Using this we can reduce the representation input size
  • 3. IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 _______________________________________________________________________________________ Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 94 instead of the full size input. Here clustering process has been used to extract features form good and bad fruits. 6.1 Clustering Basics Clustering is the processes of grouping together similar objects. The resulting groups are called clusters. Clustering algorithms group objects according to various criteria. Unlike most classification methods, clustering handles data that has no labels, or ignores the labels while clustering. Here fig 1.7 shows the clustering values of good and bad Fruits. 6.2 Clustering Algorithm: K-Means Clustering Algorithm STEP1: The training vectors are grouped into M clusters based on the distance between the code vectors and the training vectors using the below equation (1) and (2). dy= |풙풊−풚풊|풌풋 =ퟏ -------------1 Where dy is the distance between the training vector Xi and the code vector Yi . 푆푢푚푖푗 = 푋푖푗 --------------2 Where, c is the cluster strength STEP2: Compute the sum vector for every cluster by adding the corresponding components of all the training vectors that belong to the same cluster using the equation (3). 퐶푒푛푡푟표푖푑 = 푆푢푚푖푗 /푛푖 Where i=1, 2….n) STEP3: Compute the centroid for each cluster by dividing the Individual components of the sum vector by the cluster Strength in using the equation (3). STEP4: Replace the existing code vector with the new centroid to form the revised codebook. STEP5: Repeat the steps 1 through 4 till the codebooks of the consecutive iterations converge[8] 7. FEATURE TRAINING Feature training method includes collection of large number of trained features of clustered values of good and bad fruits. More number of collecting trained features gives more accuracy. In this method, the number of closest code vectors for each training vector is identified and is stored as the corresponding cluster density. The cluster densities for all training vectors are computed and are sorted in descending order. From the sorted list, the top M training vectors with higher cluster densities are identified and grouped as codebook. This codebook is saved and loaded in MATLAB for feature matching. 8. FEATURE MATCHING Feature matching methods essentially consist of identifying features in images that can be matched with corresponding features in the other images from which a transformation model can be estimated. Feature matching is an important task in the area of image processing Here correlation method is used for feature matching.. Here the clustered values of good and bad fruits are taken more in number. With the extracted features each value are correlated with one another and we get a specific value for good and bad fruit. With these values we can identify good and bad Fruits. 9. CONCLUSIONS In this paper the identification of good and bad fruits based on quality in image processing using MATLAB is successfully done with 80% accuracy. The use of image processing for identifying the quality can be applied not only to any particular fruit. We can also apply this method to identify quality of vegetables with more accuracy. Thus, this will enable the technology to be applied in many products. REFERENCES [1]. A. K. Jain, “Fundamentals of Digital Image Processing” Prentice Hall of India, First Edition,1989. [2]. Rafael C.Gonzalez and Richard E. woods, “Digital Image Processing”, Pearson Education, Second Edition,2005. [3]. Delores M.Etter,”Introduction to Matlab”,2010. [4]. R. Yang, L. Lin, M. Gabbouj, J. Astola, and Y.Neuvo, “Optimal Weighted Median Filters Under Structural Constraints,” IEEE Trans.Signal Processing, Vol. 43, PP. 591-604, Mar 1995 . [5]. Pei-Eng Ng and Kai-Kuang Ma, “A Switching Median Filter with BDND for Extremely Corrupted Images”, IEEE Trans Image Processing, Vol. 15, No. 6, PP. 1506-1516 June 2006. [6]. Gajanand Gupta ,’’Algorithm for Image Processing Using Improved Median Filter and Comparison of Mean, Median and Improved Median Filter”, International Journal of Soft Computing and Engineering(IJSCE)ISSN:2231- 2307,volume-1,Issue-5,November 2011. [7]. Sonam Saluja et al.,” A Study of Edge-Detection Methods”, International Journal of Advanced Research in Computer and Communication EngineeringVol. 2, Issue 1, January 2013. [8]. Ms.Chinki Chandhok et al.,” An Approach to Image Segmentation using K-means Clustering Algorithm”, International Journal of Information Technology (IJIT), Volume – 1, Issue – 1, August 2012.
  • 4. IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308 _______________________________________________________________________________________ Volume: 03 Special Issue: 10 | NCCOTII 2014 | Jun-2014, Available @ http://www.ijret.org 95 [9]. Gastelum-Barrios et al.,” Fruit quality evaluation with image processing: A review”, African Journal of agriculture Research vol.6(14),pp.3333-3339,18 july,2011 . [10]. Arman Arefi et al.,”Recognition and localization of ripen fruit based on machine vision”, Australian Journal of Crop Science,Ajcs 5 (10):1144-1149 (2010).