基于计算机视觉的水果分级检测系统的设计
摘要
计算机视觉应用于水果的品质检测,带来了许多方便。既可以提高检测的精度、准确度。又节省了大量的劳动力,让人们从繁重的人工检测工作中解脱出来。本文以苹果为研究对象,研究了计算机视觉技术应用于水果分级检测的基本理论和方法。
研究了苹果图像的预处理,包括平滑滤波、图像的灰度化以及图像的二值化。研究了苹果的大小检测。先把苹果图像与背景分离,再计算出苹果图像的像素点数,通过预先测定出的一个像素点与真是面积的比值,进而算出苹果的真是面积,最后通过直径的大小来确定苹果大小等级。研究了苹果的颜色检测,通过HIS颜色模型中的H分量来判定出苹果的着色面积,通过着色面积与苹果的大小做比,得出苹果的着色比,通过着色比来判定苹果颜色等级。研究了苹果的缺陷检测。对苹果图像的灰度化,再通过用合适的阀值二值化图像确定出缺陷区域,在通过一些简单的运算得出缺陷的面积,通过缺陷的面积确定苹果的缺陷等级。关键词:计算机视觉,图像处理,水果分级
TheDesig
ofFruitGradi
gDetectio
SystemBasedo
fComputerVisio
ABSTRACT
Computervisio
appliedtofruitqualityi
spectio
broughtalotofco
ve
ie
ceCa
e
ha
cethedetectio
accuracyA
dsavealotofpeopleslaborfromtheheavyma
uali
spectio
worki
ear
estSotodayIwilli
troducethebasictheorya
dmethodsofatech
ologywhichca
detectfruitthistech
ologytakesappleastheresearchobject
Appleimagepreprocessi
gi
cludi
gfilteri
gthegrayscaleoftheimagea
dthebi
arizatio
ofimages
Thesizeofthedetectio
ofappleDeparti
gapplesimagea
dbackgrou
dfirstseco
dlycalculatethe
umberoftheappleimagespixelsThirdlycalculatetheareaoftheapplei
realthroughthepredetermi
edratioofapixelareaa
ditsrealareaFi
allydetermi
etheapplessizeclassthroughdiameter
ThecolorofappledetectedbyitscolormodelHISWeusethecompo
e
tHi
HISmodeltodetermi
eapplescoloredareathroughtheratioofthecoloredareassizea
dtheapplessizei
realweca
fi
doutthecolorratioSoweca
determi
etheclassofcolorthroughcolorratio
Theappledefectdetectio
Weshouldmakeoutthegrayscaleimageoftheappleatfirsta
dthe
byusi
gtheappropriatethresholdofthebi
aryimagetodetermi
ethedefectareasoweca
drawouttheareaofthedetectio
throughsomesimpleoperatio
sFi
allyweca
determi
ethedefectlevelofthisapplethroughtheareaofdetectio
KeywordsComputervisio
imageprocessi
gfruitgradi
g
f目录
1绪论011研究的目的与意义r