外文翻译--原型基于颜色的图像检索与MATLAB.doc
英文原文PrototypingColor-basedImageRetrievalwithMATLABAbstracContent-basedretrievalof(image)databaseshasbecomemorepopularthanbefore.Algorithmdevelop-mentforthispurposerequirestesting/simulationtools,buttherearenosuitablecommercialtoolsonthemarket.Asimulationenvironmentforretrievingimagesfromdatabaseaccordinghistogramsimilaritiesispresentedinthispaper.Thisenvironmentallowstheuseofdifferentcolorspacesandnumbersofbins.ThealgorithmsareimplementedwithMATLAB.Eachcolorsystemhasitsownm-files.Thephasesofthesoftwarebuildingprocessarepre-sentedfromsystemdesigntographicaluserinterface(GUI).ThefunctionalityisdescribedwithsnapshotsofGUI.1.IntroductionNowadaystherearethousandsorhundredsofthousandsofdigitalimagesinanimagedatabase.Iftheuserwantstofindasuitableimageforhis/herpurposes,he/shehastogothroughthedatabaseuntilthecorrectimagehasbeenfoundoruseareferencebookorsome“intelligent”program.Videoondemand(VoD)servicesalsorequiresanintelligentsearchsystemforend-users.VoDsystemssearchmethodsdifferslightlyfromimagedatabasesmethods.Areferencebookisasuitableoption,iftheimagesarearrangedwithausefulmethod,forexample:1)categories:animals,flags,etc,2)names(requiresagoodnamingtechnique)or3)dates.Anexperiencedusercanusethesesystemsaswellastextualsearches(keywordshavetobeinsertedinadatabase)efficiently.Therearesituationswhenamulti-languagesystemhastobeused.Therealanguageindependentsearchsystemsbestpropertiescanbeutilized.Atoolwhichisbasedontheimagespropertiescanbemadelanguageindependent.Thesepropertiescanbeforexamplecolor,shape,texture,spatiallocationofshapeetc.IntheMuVi-project1thiskindoftoolisunderconstruction.Itwillcoverthepropertiespresentedabove.Researchworkoncontent-basedimageretrievalhasbeendonein26.Thesystem,whichispresentedinthispaper,isasimulationenvironment,whereMuViscolorcontentbasedretrievalhasbeendevelopedandtested.2.SystemdevelopmentMATLABisanefficientprogramforvectorandmatrixdataprocessing.Itcontainsreadyfunctionsformatrixmanipulationsandimagevisualizationandallowsaprogramtohavemodularstructure.BecauseofthesefactsMATLABhasbeenchosenasprototypingsoftware.2.1SystemdesignBeforeanym-fileshavebeenwritten,thesystemdesignhasbeendone.AsystemdesignfortheHSV(hue,saturationandvalue)colorsystembasedretrievalprocessispresentedinFigure1.Similardesignhasbeendoneforallusedcolorsystems.Figure1:FunctionchartforHSVcolorspacewith27binshistogram.Tesths27isthemainfunctionforthiscolorsystemandthisnumberofbins.Itcallsotherfunctions(hs27read,dif_hsvandimage_pos)whenneeded.Eachcolorsystemhasamainfunctionofitsownandvariablenumber(23)ofsub-functions.Ifthereisnoneedforcolorspaceconversionthereare2functions,otherwise3functionsonthefirstbranchofthefunctionchart.Thefunctioncallofthemainfunctionis:matches=tesths27(imagen,directory,num)Thevariableimagenspecifiesthequeryimagesnameandpath.Thedirectoryisapathoftheimagedatabaseandnumisadesirednumberofretrievedimages.2.2FunctionsAtthismomenttherearefunctionsimplementedforfourcolorspaces:HSV,L*a*b*,RGBandXYZ7.Eachcolorspacehasfrom2to4implementationsfordifferentnumbersofbins.Therearealtogether14mainfunctions.Forsomecolorsystemsitispossibletomakethesefunctionsdynamic,i.e.dynamichistogramcalculation.Everycolorsystem/bincombinationrequiresitsownhistogramsandthesecanbemadeonlywithanexhaustivemethod(pixelbypixel).Histogramcalculationtakes½-5minutesperimage,eachapproximately320×240pixels,dependingonthecomplexityofthecolorspaceon150MHzPentium.Thusitisnotreasonabletolettheuserselectabinnumberfreely,especiallyinthecaseoflargedatabases.Thefunctionshavebeennamedsothatthenamescontaininformationofthecolorspaceused,thepurposeofthefunctionsandthenumberofusedbins.Somefunctions,forexampleimage_pos,havebeenusedbymanyorallmainfunctionsandthesefunctionshavenotbeennamedasdescribedabove.Themainfunctionchecks,ifthefunctioncalliscorrect.Ifthequeryimagesnamedoesntcontainapath,thefunctionassumesthattheimageissituatedinthedatabasedirectory.Inadditiontothis,themainfunctionchecks,ifthequeryimagealreadyhasahistograminthecurrentlyuseddatabase.Iftherequiredhistogramisnotthere,theimageread(forexamplehs27read)functioniscalled.Thisfunctionalsonormalizespixelvaluesandarrangesimagematrixdatatoavectorformat.Afterthatstageacolorspaceconversionfunction(ifneeded)iscalled.Finallyaquantizationfunctionbuildsthehistogramwiththecorrectnumberofbins.Thehistogramwillthenbesavedintothedatabasedirectory.Ifthehistogramalreadyexiststhere,thethreepreviousstepswillnotbeexecuted.Nowthequeryimagehasbeenanalyzed.Thenthemainfunctionwillgothroughallimagesinthedatabasedirectorywithanalmostsimilaralgorithmasinthecaseofthequeryimage.Thedifferenceisthatnowtherewillbeahistogramdifferencecalculationbetweenthequeryimagesandcurrentimageshistogram.Finallytheimage_posfunctionwillbeusedtoputaqueryimageandthedesirednumberofbestmatchimagesonthedisplay.2.3LinkingItisnotpossibletouseaprogrambeforethemainfunctionandsub-functionsareconnectedtoeachother.Themainfunctionwillbecalledfromthecommandlineorthroughthegraphicaluserinterface,whichwillbepresentedlaterinthispaper.Inbothcasesthefunctioncallwillcontainthesamearguments.Formulti-levelsearchpurposesseparatemainfunctionshavebeenimplemented,butitispossibletoutilize“normal”functionsandaddoneparameter,wherethebestmatchesarraycanbetransferredforsecondastagecomparisonfunction.Themainfunctioncallsanimagereadfunctionwiththeimagesname.Thehistogramwillbereturnedtothemainfunction.Ifacolorspaceconversionisneeded,theconversionfunctionwillbecalledfromthereadfunctionwithr,gandbvectors.Thehistogramwillbereturnedtothecallingfunction.Finallythehistogrambuildfunctionwillbecalledwithconvertedcolorvectors.Thisfunctionreturnsaquantizedhistogram,whichwillgothroughallfunctionsuntilitachievesthemainfunction.Themainfunctioncallsthehistogramdifferencefunctionwithtwohistogramvectorsandwillgetadifferencevalueasaresponse.ThedifferencefunctionusesEuclidean-distancecalculation,butitcanbeeasilychangedtoanotheralgorithmduetothemodularityoftheprogram.Ifthedifferenceissmallerthanlargestdifferenceonabestmatchtable,thecurrentresultwillbewrittenoverthelastresultonthebestmatchtable.Afterthatthetableisarrangedagaininanascendingorderofdistance.Whenalltheimageshavebeenanalyzed,thesortedbestmatchtable,thenumberofdesiredoutputimages,thequeryimagesname,thesearchimagespathandthedatabasepatharetransferredtotheimage_posfunction.Thesevaluescanbetransferredintolargercomponents(vectors/containers).Nowtheprogramworksfasterwithseveralinputarguments,becausethereisnoneedforpickingupvariablesfromacontainer.2.4GraphicaluserinterfaceThegraphicaluserinterface(GUI)isanimportantpartofsoftwaredevelopment.ThedesigningoftheGUIhavetosolvethefollowingproblems:learningtime,speedofperformance,rateoferrorsbyusers,retentionovertime,andsubjectivesatisfaction9.Thissoftwareis,atthemoment,intendedtobeusedonlyfortestingpurposes.Themostimportantpropertyofthissoftwareisthattheresultsofdifferenttestqueriescanbeseenquicklyandtheresultscanbesavedsafelyonadisk.Thusthevisuallayoutisnotasimportantasincaseofacommercialsoftwareproduct.InFigure2thefirstscreenonGUIispresented.Thepurposesofthebuttons,menusandothercomponentswillbepresentedlater.Ifthissoftwareisdevelopedintoacommercialproduct,themenubarwillbedisabledinthefutureandtheexitandhelpbuttonswillbeaddedonthecanvas.Figure2:GUIbeforethesearchimageselection.InFigure3thesearchscreenispresentedjustbeforestartingasearch.Theuserisshownasearchimage,andinthiswayhe/shecanbesurethatthesearchwillbemadewiththecorrectimage.