Está en la página 1de 4

8/22/2015

ImageArithmeticLogarithmOperator

LogarithmOperator

CommonNames:PixelLogarithm,DynamicRangeCompression

BriefDescription
Thedynamicrangeofanimagecanbecompressedbyreplacingeachpixelvaluewithitslogarithm.Thishastheeffectthatlow
intensitypixelvaluesareenhanced.Applyingapixellogarithmoperatortoanimagecanbeusefulinapplicationswherethe
dynamicrangemaytoolargetobedisplayedonascreen(ortoberecordedonafilminthefirstplace).

HowItWorks
Thelogarithmicoperatorisasimplepointprocessorwherethemappingfunctionisalogarithmiccurve.Inotherwords,each
pixelvalueisreplacedwithitslogarithm.Mostimplementationstakeeitherthenaturallogarithmorthebase10logarithm.
However,thebasisdoesnotinfluencetheshapeofthelogarithmiccurve,onlythescaleoftheoutputvalueswhicharescaled
fordisplayonan8bitsystem.Hence,thebasisdoesnotinfluencethedegreeofcompressionofthedynamicrange.The
logarithmicmappingfunctionisgivenby

Sincethelogarithmisnotdefinedfor0,manyimplementationsofthisoperatoraddthevalue1totheimagebeforetakingthe
logarithm.Theoperatoristhendefinedas

Thescalingconstantcischosensothatthemaximumoutputvalueis255(providingan8bitformat).ThatmeansifRisthe
valuewiththemaximummagnitudeintheinputimage,cisgivenby

Thedegreeofcompression(whichisequivalenttothecurvatureofthemappingfunction)canbecontrolledbyadjustingthe
rangeoftheinputvalues.Sincethelogarithmicfunctionbecomesmorelinearclosetotheorigin,thecompressionissmallerfor
animagecontainingsmallinputvalues.ThemappingfunctionisshownfortwodifferentrangesofinputvaluesinFigure1.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/pixlog.htm

1/4

8/22/2015

ImageArithmeticLogarithmOperator

Figure1Logarithmicmappingfunctionsattwodifferentscales.

GuidelinesforUse
ThemostcommonapplicationforthedynamicrangecompressionisforthedisplayoftheFourierTransform.Wewillillustrate
thisusing

ThemaximummagnitudevalueofitsFourierTransformis

,andthesecondlargestvalueisapproximately10times

smaller.Ifwesimplylinearlyscalethisimage,weobtain

Duetothelargedynamicrange,wecanonlyrecognizethelargestvalueinthecenteroftheimage.Allremainvaluesappearas
blackonthescreen.IfweinsteadapplythelogarithmicoperatortotheFourierimage,weobtain

Here,smallerpixelvaluesareenhancedandthereforetheimageshowssignificantlymoredetails.
Thelogarithmicoperatorenhancesthelowintensitypixelvalues,whilecompressinghighintensityvaluesintoarelativelysmall
pixelrange.Hence,ifanimagecontainssomeimportanthighintensityinformation,applyingthelogarithmicoperatormight
leadtolossofinformation.Forexample,
http://homepages.inf.ed.ac.uk/rbf/HIPR2/pixlog.htm

2/4

8/22/2015

ImageArithmeticLogarithmOperator

isthelinearlyscaledFourierTransformof

Theimageshowsonebrightspotinthecenterandtwodarkerspotsonthediagonal.Wecaninferfromtheimagethatthese
threefrequenciesarethemaincomponentsoftheimagewiththeDCvaluehavingthelargestmagnitude.Applyingthe
logarithmictransformtotheFourierimageyields

Here,wecanseethattheimagecontainsmanymorefrequencies.However,itisnowhardtotellwhicharethedominatingones,
sinceallhighmagnitudesarecompressedintoarathersmallpixelvaluerange.Themagnitudeofcompressionislargeinthis
casebecausethereareextremelyhighintensityvaluesintheoutputoftheFourierTransform(inthiscaseupto
).We
candecreasethecompressionratebyscalingdowntheFourierimagebeforeapplyingthelogarithmictransform.Image

istheresultoffirstmultiplyingeachpixelwith0.0001andthentakingitslogarithm.Now,wecanrecognizeallthemain
componentsoftheFourierimageandcanevenseethedifferenceintheirintensities.
Thus,alogarithmictransformisappropriatewhenwewanttoenhancethelowpixelvaluesattheexpenseoflossofinformation
inthehighpixelvalues.Forexample,themanin

wasphotographedinfrontofabrightbackground.Thedynamicrangeofthefilmmaterialistoosmall,sothatthegraylevelson
thesubject'sfaceareclusteredinasmallpixelvaluerange.Alogarithmictransformspreadsthemoverawiderrange,whilethe
highervaluesarecompressed.Theresultcanbeseenin

Ontheotherhand,applyingalogarithmictransformto

islessappropriate,becausemostofitsdetailsarecontainedinthehighpixelvalues.Applyingthelogarithmicoperatoryields

Thisimageshowsthatalotofinformationislostduringthetransform.
http://homepages.inf.ed.ac.uk/rbf/HIPR2/pixlog.htm

3/4

8/22/2015

ImageArithmeticLogarithmOperator

CommonVariants
Thelogarithmicoperatorisamemberofthefamilyofanamorphosisoperators,whichareLUTtransformationswithastrictly
increasingordecreasingmappingfunction.
Ananamorphosisoperatorwhichissimilartothelogarithmictransformisthesquarerootoperator.Itsmappingfunctionis
definedas

Bothoperatorsincreasethecontrastoflowpixelvaluesatthecostofthecontrastofhighpixelvalues.Hence,botharesuitable
toenhancedetailscontainedinthelowvalues.However,theyproduceslightlydifferentenhancements,sincetheshapesoftheir
curvesarenotidentical.

InteractiveExperimentation
Youcaninteractivelyexperimentwiththisoperatorbyclickinghere.

Exercises
1. Applythelogarithmicoperatorto

Doesthisprocessimprovetheimage.Whatisthereason?Whatistheresultusing

2. Isitgenerallyagoodideatoapplythelogarithmicoperatortoastronomicalimages?Tryiton

References
R.GonzalezandR.WoodsDigitalImageProcessing,AddisonWesleyPublishingCompany,1992,pp167168.
A.JainFundamentalsofDigitalProcessing,PrenticeHall,1989,p240.

LocalInformation
Specificinformationaboutthisoperatormaybefoundhere.
MoregeneraladviceaboutthelocalHIPRinstallationisavailableintheLocalInformationintroductorysection.

2003R.Fisher,S.Perkins,A.WalkerandE.Wolfart.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/pixlog.htm

4/4

También podría gustarte