REAL FRUIT DEFECTIVE DETECTION BASED ON IMAGE PROCESSING TECHNIQUES USING OPENCV

Page 1

REAL FRUIT DEFECTIVE DETECTION BASED ON IMAGE PROCESSING TECHNIQUES USING OPENCV

Student [1], Dept. of Computer science and engineering, Vivekananda college of Engineering for Women, Namakkal, Tamil Nadu, India

Professor [2,3], Dept. of Computer science and engineering, Vivekananda college of Engineering for Women, Namakkal, Tamil Nadu, India. ***

Abstract – India is a nation of farmers. India produces a wide variety of vegetables and fruits. After China, India produces the second most fruit. The use of a traditional method to classify the quality of fruits in the industry is difficult, so the image processing method was developed to do so. Because India's economy is basedonagriculture, automation of agriculture and related industries is crucial. In supermarkets, it is difficult to recognize the various varieties of fruits and vegetables because the cashier must indicate the categories for each fruit in order to determine its price. The majority of this issue with packaged goods has been resolved by the use of barcodes; however, sincethemajorityofcustomersprefer to select their own items, these items cannot be prepackaged and must be weighed. Issuing codes for each fruit is one option, but this requires a lot of memorizations and could result in pricing mistakes. The cashier could also be given aninventorywithpicturesand codes, but flipping through the booklet takes time. Due to the diverse characteristics of numerous fruit varieties, it is still challenging to use computer vision to automatically classify fruits. The methodfordetermining fruit quality that relied on the shape, size, and colorofthe fruit as its external characteristics. The computer visionbased method fordeterminingfruitqualityispresentedin this project. This technology is being used moreandmore in the fruit industry and agriculture. Systematic, economical, hygienic,consistent,andobjectiveevaluation is made possible by computervision.Fruit'sappearanceis one important quality characteristic. In addition to influencing their market value, consumer preferences, and choice, appearance has an impact on their internal quality.

Key Words: ImageProcessingmethod,appearance,fruit industry

I.INTRODUCTION

Inthefruitindustry,computervisionandimageprocessing techniqueshavebecomeincreasinglyuseful,particularlyfor qualitydetection.Computervisionsystemscouldbeusedto improveproductquality,accordingtoresearchinthisfield.

Indiaisanationoffarmers.Indiaproducesawidevarietyof vegetablesandfruits.AfterChina,Indiaproducesthesecond most fruit. The use of a traditional method to classify the quality of fruits in the industry is difficult, so the image processingmethodwasdevelopedtodoso.BecauseIndia's economyisbasedonagriculture,automationofagriculture andrelatedindustriesiscrucial.Thecomputervision-based method for determining fruit quality is presented in this project.Thistechnologyisbeingusedmoreandmoreinthe fruit industry and agriculture. Systematic, economical, hygienic, consistent, and objective evaluation is made possible by computer vision. Fruit's appearance is one importantqualitycharacteristic.Inadditiontoinfluencing their market value, consumer preferences, and choice, appearancehasanimpactontheirinternalqualitytosome extent.India is a nationoffarmers.India producesa wide varietyofvegetablesandfruits.AfterChina,Indiaproduces the second most fruit. The use of a traditional method to classifythequalityoffruitsintheindustryisdifficult,sothe imageprocessingmethodwasdevelopedtodoso.Because India's economy is based on agriculture, automation of agriculture and related industries is crucial. Fruits are processed in several steps after they are picked: sorting, packing,grading,transporting,andwashingCountrieswith highagriculturalproductivity,suchasIsraelandAustralia, have demonstrated active use of this cutting-edge technology, which must be introduced to the Indian fruit industry.

II. PROBLEM STATEMENT

Colour,texture,andsizearetherequiredcharacteristics.On the acquired image, precise feature pre-processing is performed.Theenhancementofanimage'sfeaturesthatare crucial for subsequent processing and the suppression of undesirable distortions are the primary goals of image processing.ConvertinganRGBimagetoagrayscaleimageis thefirstofthefundamentalpre-processingsteps.TheGray image is then subjected to image histogram equalization. Adjusting image intensities to increase contrast is made easierwiththis.Filteroutnoise;themedianfilterisusedto removenoise;theLaplacianfilterisusedforedgedetection becauseitfocusesontheareawithrapidintensitychanges.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 03 | Mar 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page883

As a result, this improved, noise-free, filtered image is preparedforfurtherprocessing.

III EXISTING SYSTEM

Fruitsareprocessedinseveralstepsaftertheyarepicked: sorting,packing,grading,transporting,andwashingFruit's appearance is one important quality characteristic. In addition to influencing their market value, consumer preferences,andchoice,appearancehasanimpactontheir internalqualitytosomeextent.Fruitqualityevaluationhas becomeincreasinglysignificantinrecentyearsinorderto satisfy the desires of consumers as well as socioeconomic needs.Sensoryproperties(appearance,texture,flavor,and aroma),nutritivevalues,chemicalcomponents,mechanical properties, functional properties, and defects are all componentsofproducequality.Allfruitsundergostructural andchemicalchangesduringtheirshortshelflife.Asaresult, knowinghowgoodfruitsareduringtheirshelflifeiscritical. Theunderlyingactivityofthebiologicalsampleisreferredto asbio-activity.Theclimaticconditionsalsohaveanimpact onthefruit'sbioactivityduringitsshelflife.

3.1 Disadvantages

 WeIndians,inparticular,cannotaffordthepricesof thefruitprocessingfacilitiesoftoday.

 The market value of a fruit is influenced by its physical appearance, so proper handling after harvestisessential.

IV. PROPOSED SYSTEM

Themostimportantparametersfordeterminingfruitquality areitstexture,color,andsize.Inthefruitindustry,computer vision and image processing techniques have become increasingly useful, particularly for quality detection. Computervisionsystemscouldbeusedtoimproveproduct quality,accordingtoresearchinthisfield.Inrecentyears, theuseofcomputervisionforfruitinspectionhasgrown.As aresultofthemarket'sconstantdemandforproductsofa higher quality, computer vision inspection systems have beenenhancedwithadditionalfeatures.Intheareaoffresh productinspection,computertechnologyhasbeenutilizedin thefoodandagriculturalindustries.Basedonitsquality,it tellsyouwhetherthefruitisgoodorbad.

To satisfy the purchaser's craving and socio - monetary necessity,organicproductqualityassessmentturnsouttobe vital now daily. Nature of produce envelops tangible properties(appearance,surface,tasteandsmell),nutritive qualities, compound constituents, mechanical properties, utilitarian properties and imperfections. Every one of the natural products have restricted time span of usability during which it goes through underlying and compound changes.Inthisway,knowingthenatureoforganicproducts

during timeframe of realistic usability is significant. Bioactionalludestothehiddenactionoftheorganicexample. Thebioactivityofthenaturalproduct'sprogressionsduring theirtimespanofusabilityanditisadditionallyimpactedby the climatic circumstances. Various strategies for quality assessment of horticultural items have been created by variousscientists.Laserbiodotmethodisnon-contactand non-damagingmethodforassessingthefundamentalaction of organic products which thusly gives their quality data. Surface,VarietyandSizearethesignificantboundariesfor organic product quality distinguishing proof. The variety acknowledgment is vital cycle in readiness location. The readinessdiscoveryisouterqualitycomponent.Inanycase, surface is likewise vital. On account of surface deserted organic product can be perceived. Surface examination recognizesthenon-consistencyoforganicproductexternal surface. The size is additionally significant boundary. It plainly seen boundary all client select natural product in viewofsize.

4.1 Advantages of Proposed System

 Thefruit'squalitycanbeeasilydetermined.

 Acomputervisionsystemisusedtoreplacemanual foodinspectionbyprovidingauthentic,equitable

V. RELATED WORK

5.1 ACQUIRING THE IMAGES OF THE FRUITS

In this project, we compiled a list of both high- and lowqualityfruitimagedatabases.Forbetterresults,thesefruit imagedatabasesarehelpful.

5.2 DETECTION PROCESS

AnRGBimageistransformedusingtheHSVcolorspace.The lower and upper ranges are then established. Then, the rangesofbinaryimagesareset.Turnthemaskbackintoa three-channeloneafterthat.3.Inthisinstance,theHSVcolor thresholderscriptisusedtodeterminethelowerandupper thresholdsforextractinga redobject.Inaddition,theHSV colorspacerevealswhetherornotanimageispresentinthis system

5.3 DETECTION OF DEFECTIVE FRUITS

Identifyingthedamagedtomatoisacrucialstepinthepreprocessingprocess.Thecolorimageofthetomatowasused fortheanalysis.Ifthepixel valuefallsbelowthespecified threshold,fruitofpoorqualityisdeemedtohavedefective skin.Anypixelvaluethatisgreaterthanthethresholdvalue chosenisusedtorepresentpureskin,alsoknownashighqualityfruit.Afterthat,thetotalnumberofwhitepixelsis calculated, which will be the same as the total number of pixels thatrepresentdamagedskin

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 03 | Mar 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page884

VI. SYSTEM ARCHITECTURE

thresholding,thatimageissubjectedtobinarythresholding. Afterthat,morphologicaloperationslikedilationanderosion are carried out. Opening is done in order to detect the boundaries.Thelengthsofthemajorandminoraxesarethen calculated. The sizes of small, medium, and large are then selected.

8.1 OBJECT DETECTION

VII.OPENCV

OpenCVisthecolossalopen-sourcelibraryforthePCvision, AI, and picture handling and presently it assumes a significant part continuously activity which is vital in the present frameworks. By utilizing it, one can deal with picturesandrecordingstorecognizeitems,faces,orinany event, penmanship of a human. At the point when it incorporatedwithdifferentlibraries,forexample,Numpuy, pythonisequippedforhandlingtheOpenCVclusterstructure for investigation. To Distinguish picture design and its different highlights we use vector space and perform numerical procedure on these elements. The principal OpenCV form was 1.0. OpenCV is delivered underaBSDpermitandthusit'sfreeforbothintellectualand business use. It has C++, C, Python and Java points of interaction and supports Windows, Linux, Macintosh operating system, iOS and Android. At the point when OpenCVwasplannedthefundamentalcenterwasongoing applications for computational proficiency. Everything is writteninenhancedC/C++toexploitmulti-centerhandling.

VIII. SYSTEM CONFIGURATIONS

Proper image acquisition is crucial to the successful operationofthefruitsortingandgradingsystem.Becausethe imagewastakenwiththecamera,ithasnoiseanditsfeatures aredifficulttosee,soitissubjectedtoimagepreprocessing. Color, texture, and size are the required features for this project. The acquired image undergoes preprocessing in ordertoachieveprecisefeature.Theenhancementofimage featuresthatareessentialforsubsequentprocessingandthe eliminationofundesirabledistortionsaretheprimarygoals ofimageprocessing.ConvertinganRGBimagetoagrayscale imageisthefirstofthefundamentalpreprocessingsteps.The grayimageisthensubjectedtoimagehistogramequalization Adjusting image intensities to increase contrast is made easierwiththis.Usingafilter,removenoise inthiscase,the median filter. Because it highlights the region with rapid intensitychange,theLaplacianisutilizedforedgedetection. As a result, this improved, noise-free, filtered image is preparedforfurtherprocessing.Thepictureistaken.First, change the image from RGB to grayscale. Following OSTU

Proper image acquisition is crucial to the successful operationofthefruitsortingandgradingsystem.Becausethe imagewastakenwiththecamera,ithasnoiseanditsfeatures aredifficulttosee,soitissubjectedtoimagepreprocessing. Color, texture, and size are the required features for this project. The acquired image undergoes preprocessing in ordertoachieveprecisefeature.Theenhancementofimage featuresthatareessentialforsubsequentprocessingandthe eliminationofundesirabledistortionsaretheprimarygoals ofimageprocessing.ConvertinganRGBimagetoagrayscale imageisthefirstofthefundamentalpreprocessingsteps.The grayimageisthensubjectedtoimagehistogramequalization. Adjusting image intensities to increase contrast is made easierwiththis.Usingafilter,removenoise inthiscase,the median filter. Because it highlights the region with rapid intensitychange,theLaplacianisutilizedforedgedetection. As a result, this improved, noise-free, filtered image is preparedforfurtherprocessing.Thepictureistaken.First, change the image from RGB to grayscale. Following OSTU thresholding,thatimageissubjectedtobinarythresholding. Afterthat,morphologicaloperationslikedilationanderosion are carried out. Opening is done in order to detect the boundaries.Thelengthsofthemajorandminoraxesarethen calculated. The sizes of small, medium, and large are then selected.

IX. CONCLUSION

Using OPENCV/PYTHON, this project successfully and precisely identifies normal and defective fruits based on quality. Image processing can be used to determine the qualityofanyfruit,butnotjustanyfruit.Thismethodcan alsobeusedtomorepreciselyidentifyvegetablequality.Asa result,thetechnologywillbeabletobeusedinavarietyof products.Computervisionsystems,whichprovideauthentic, equitable,andnon-destructiveratings,areutilizedtoreplace manual food inspection. Python-based software OpenCV performstheimageprocessing.Thefirstpartofthesoftware isforimageanalysis,andthesecondpartisforcontrolling hardware based on the results of image processing. The systemoperatesintwodistinctways,withthecamerataking the picture and the control module performing all image processing.Alloftheprocessesaredisplayedonthemonitor and then based on the control module's decision. The assemblyoftheconveyorisoperated.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 03 | Mar 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page885

REFERENCES

[1]AmitangshuPalandKrishnaKant,“MagneticInduction Based Sensing and Localization for Fresh Food Logistics”, 2017IEEE42ndConferenceonLocalComputerNetworks.

[2] Yating Chai, Howard C. Wikle, Zhenyu Wang, Shin Horikawa,SteveBestetal.,“Designofasurface-scanningcoil detectorfordirectbacteriadetectiononfoodsurfacesusinga magnetoelasticbiosensor”,journalofappliedphysics114, 104504(2013).

[3] Amitangshu pal, Krishna Kant, “Smart Sensing, Communication, and Control in Perishable Food Supply Chain”,ACMTransactionsonSensorNetworks,Vol.1,No.1, Article.Publicationdate:March2018.

[4] Reiner Jedermann, Thomas Potsch and Chanaka Lloyd, “Communicationtechniquesandchallengesforwirelessfood qualitymonitoring”,publishedbyroyalsociety2014.

[5]AmitangshuPalandKrishnaKant,“IoT-BasedSensingand Communications Infrastructure for the Fresh Food Supply Chain”,publishedbyIEEEcomputersociety2018.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 03 | Mar 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page886

Turn static files into dynamic content formats.

Create a flipbook