原型基于颜色的图像检索与MATLAB论文Word文件下载.docx
《原型基于颜色的图像检索与MATLAB论文Word文件下载.docx》由会员分享,可在线阅读,更多相关《原型基于颜色的图像检索与MATLAB论文Word文件下载.docx(33页珍藏版)》请在冰豆网上搜索。
2TampereUniversityofTechnology,SignalProcessingLaboratory,Tampere,Finland
Abstract
Content-basedretrievalof(image)databasesbefore.Algorithmdevelop-mentforthispurposerequirestestingsimulationtools,buttherearenosuitablecommercialtoolsonthemarket.
Asimulationenvironmentforretrievingimagesfromdatabaseaccordingthispaper.Thisenvironmentallowstheuseofdifferentcolorspacesandnumbersofbins.ThealgorithmsareimplementedwithMATLAB.Eachcolorsystemm-files.
Thephasesofthesoftwarebuildingprocessarepre-sentedfromsystemdesigntographicaluserinterface(GUI).ThefunctionalityisdescribedwithsnapshotsofGUI.
1.Introduction
Areferencebookisasuitableoption,iftheimagesarearrangedwithausefulmethod,forexample:
1)categories:
animals,flags,etc,2)names(requiresagoodnamingtechnique)or3)dates.Anexperiencedusercanusethesesystemsaswellastextualsearches(keywordsadatabase)efficiently.Therearesituationswhenamulti-languagesystembeutilized.Atoolwhichisbasedontheimages’propertiescanbemade
languageindependent.Thesepropertiescanbeforexamplecolor,shape,texture,spatiallocationofshapeetc.
IntheMuVi-project[1]thiskindoftoolisunderconstruction.Itwillcoverthepropertiespresentedabove.Researchworkoncontent-basedimageretrievaldonein[2–6].Thesystem,whichispresentedinthispaper,isasimulationenvironment,whereMuVi’scolorcontentbasedretrievaldevelopedandtested.
2.Systemdevelopment
MATLABisanefficientprogramforvectorandmatrixdataprocessing.Itcontainsreadyfunctionsformatrixmanipulationsandimagevisualizationandallowsaprogramtochosenasprototypingsoftware.
2.1Systemdesign
Beforeanym-fileswritten,thesystemdesignhasbeendone.AsystemdesignfortheHSV(andvalue)colorsystembasedretrievalprocessispresentedinFigure1.Similardesigndoneforallusedcolorsystems.
Figure1:
FunctionchartforHSVcolorspacewith27binsfunctionforthiscolorsystemandthisnumberofbins.Itcallsotherfunctions(needed.Each
colorsystemfunctionofitsownandvariablenumber(2–3)ofsub-functions.Ifthereisnoneedforcolorspaceconversionthereare2functions,otherwise3functionsonthefirstbranchofthefunctionchart.
Thefunctioncallofthemainfunctionis:
matches=tesths27(imagen,directory,num)
Thevariableimagenspecifiesthequeryimage’snameandpath.Thedirectoryisapathoftheimagedatabaseandnumisadesirednumberofretrievedimages.
2.2Functions
Atthismomenttherearefunctionsimplementedforfourcolorspaces:
HSV,L*a*b*,RGBandXYZ[7].Eachcolorspacefunctions.
Forsomecolorsystemsitispossibletomakethesefunctionsdynamic,i.e.dynamic.Everycolorsystembincombinationrequiresitsownbemadeonlywithanexhaustivemethod(pixelbypixel).Histogramcalculationtakes½
-5minutesperimage,each
Thefunctionsnamedsothatthenamescontaininformationofthecolorspaceused,thepurposeofthefunctionsandthenumberofusedbins.Somefunctions,forexampleimage_pos,usedbymanyorallmainfunctionsandthesefunctionsnamedasdescribedabove.
Themainfunctionchecks,ifthefunctioncalliscorrect.Ifthequeryimage’snamedoesn’tcontainapath,thefunctionassumesthattheimageissituatedinthedatabasedirectory.Inadditiontothis,themainfunctionchecks,ifthequeryimagealreadythecurrentlyuseddatabase.Iftherequirediscalled.Thisfunctionalsonormalizespixelvaluesandarrangesimagematrixdatatoavectorformat.Afterthatstageacolorspaceconversionfunction(ifneeded)iscalled.Finallyaquantizationfunctionbuildsthebesavedintothedatabasedirectory.Iftheanalyzed.Thenthemainfunctionwillgothroughallimagesinthedatabasedirectorywithanalmostsimilaralgorithmasinthecaseofthequeryimage.Thedifferenceisthatnowtherewillbea
betweenthequeryimage’sandcurrentimage’swillbeusedtoputaqueryimageandthedesirednumberofbestmatchimagesonthedisplay.
2.3Linking
Itisnotpossibletouseaprogrambeforethemainfunctionandsub-functionsareconnectedtoeachother.Themainfunctionwillbecalledfromthecommandlineorthroughthegraphicaluserinterface,whichwillbepresentedlaterinthispaper.Inbothcasesthefunctioncallwillcontainthesamearguments.Formulti-levelsearchpurposesseparatemainfunctionsimplemented,butitispossibletoutilize“normal”functionsandaddoneparameter,wherethebestmatchesarraycanbetransferredforsecondastagecomparisonfunction.
Themainfunctioncallsanimagereadfunctionwiththeimage’sname.Thefunction.Ifacolorspaceconversionisneeded,theconversionfunctionwillbecalledfromthereadfunctionwithr,gandb–vectors.The.Finallythewillbecalledwithconvertedcolorvectors.Thisfunctionreturnsaquantizedfunction.
ThemainfunctioncallsthewithtwousesEuclidean-distancecalculation,butitcanbeeasilychangedto
anotheralgorithmduetothemodularityoftheprogram.Ifthedifferenceissmallerthanlargestdifferenceonabestmatchtable,thecurrentresultwillbewrittenoverthelastresultonthebestmatchtable.Afterthatthetableisarrangedagaininanascendingorderofdistance.Whenalltheimagesanalyzed,thesortedbestmatchtable,thenumberofdesiredoutputimages,thequeryimage’sname,thesearchimage’spathandthedatabase
patharetransferredtotheimage_posfunction.Thesevaluescanbetransferredintolargercomponents(vectorscontainers).Nowtheprogramworksfasterwithseveralinputarguments,becausethereisnoneedfor
pickingupvariablesfromacontainer.
2.4Graphicaluserinterface
Thegraphicaluserinterface(GUI)isanimportantpartofsoftwaredevelopment.ThedesigningoftheGUIovertime,andsubjectivesatisfaction[9].Thissoftwareis,atthemoment,intendedtobeusedonlyfortestingpurposes.Themostimportantpropertyofthissoftwareisthattheresultsofdifferenttestqueriescanbeseenquicklyandthe
resultscanbesavedsafelyonadisk.Thusthevisuallayoutisnotasimportantasincaseofacommercialsoftwareproduct.
InFigure2thefirstscreenonGUIispresented.Thepurposesofthebuttons,menusandothercomponentswillbepresentedlater.Ifthissoftwareisdevelopedintoacommercialproduct,themenubarwillbedisabledinthefutureandtheexitandthecanvas.
Figure2:
GUIbeforethesearchimageselection.
InFigure3thesearchscreenispresentedjustbeforestartingasearch.Theuserisshownasearchimage,andinthiswaybesurethatthesearchwillbemadewiththecorrectimage.
Figure3:
GUIjustbeforerunningaquery.
TheresultsofthequerywillbepresentedonthescreenintheformatwhichispresentedinFigure6.
3.Usingthesoftware
ThefirstscreenpresentedinFigure2.Theusercanchoosefrompop-upmenus(seeFigure4),ifthesearchismadewithoneacolorsystemorasamulti-levelsearch.Inaone-levelsearcharoughlyquantizedoramoreaccurateoneloop(onecolorsystem).
Figure4:
Colorsystemselectionfromapopupmenu.
Thesecondmenuisdisabledbecauseaone-levelsearchisselected.
Inamulti-levelsearchtwodifferentcolorsystemsthesecondloopcanbeeitherthesameasonthefirstlooporadifferentone.Forquerieswithone-levelsearchtheselectionofasecondcolorsystemisdisabled.Theusercanselectthenumberofretrievedimagesatthefinalstage.Thesoftwarecanbelinkedtomanyimagedatabasesandtheusercanselectadatabasewherethequerywillbedirected.
Theusercanselectasearchimageeitherfromthesamedatabasewherethequerywillbedirectedto(default)orfromanydirectoryinwillbemadewiththefile–opendialog,whichispresentedin
Figure5.Theformcanbeclearedwiththe“Reset”button.Aqueryisexecutedwiththe“Search”button.Finallytheresultsofthesearchwillappearonthescreeninaseparatewindow,aspresentedinFigure6.Earlier[8]thesoftware
openedeachimageinaseparatewindowandevaluatingsavingtheresultsismoredifficultthanaftertheimprovement.Inthetoplefttopcorneristheoriginalqueryimage.Belowthatimagethebestmatchesarepresentedinadescendingorderofsimilarityfromlefttorightandfromtoptobottom.Theusercanselectsuitableimagesforfurtherusewiththe“Copyselected”orthe
“Printselected”buttons.The“Newsearch”buttonclosesthisformandgoesbacktotheoriginalsearchform.The“Searchsimilar”buttonexecutesanewsearchwhereaquery21as“Numberofmatchingimages”,thebestmatcheswillbeshownonmultiplescreens.Theusercanbrowsethesepageswiththe“Previouspage”and“Followingpage”
buttons.
Figure5:
Thequeryimageselectiondialog.Thelanguageofthedialogdependsonthelanguageoftheoperatingsystemused.
Figure6:
Theresultsofaquerywillbepresentedgraphically.
4.Summary
Thecolorcontent-basedretrievalrequiresalgorithms,whichgivevisuallycorrectresults.Correctlyworkingalgorithmscannotbechosenbeforesimulations.Thesoftwarepresentedinthispaperisintendedtobeused
fortestingpurposes.Someoperationswillbeimplemented,ifthesoftwareisdevelopedintoacommercialproduct.Somemodificationsareunder
construction.
Thissoftwareusedasatestingplatformfortests.Themodularityofthisprogrammakesitpossibletotakenewalgorithmsasapartofthesoftwareinashorttime.MATLABmakes
quickp