You are on page 1of 33

WhatisTexture

thefeel,appearance,orconsistencyofasurfaceora substance. Everydaytextureterms rough,silky,bumpy refer to touch. WhatisRoughTexture Wh i R hT alargedifferencebetweenhighandlowpoints,and aspacebetweenhighsandlowsapproximatelythesame a space between highs and lows approximately the same sizeasafinger. Whatissilktexture littledifferencebetweenhighandlowpoints,and l l d ff b h h dl d thedifferenceswouldbespacedveryclosetogether relativetofingersize. g

ImageTexture Image Texture


Image texture works in the same way except Imagetextureworksinthesameway,except thehighsandlowsarebrightnessvaluesor greylevels,GL,ordigitalnumbers,DN) grey levels GL or digital numbers DN) insteadofelevationchanges. Instead of probing a finger over the surface a Insteadofprobingafingeroverthesurface,a "window" a(usuallysquare)boxdefiningthe sizeoftheprobe isused. size of the probe is used

image Texture?
Texture is a repeating pattern of local variations in image intensity: i i characterized by the spatial distribution of intensity levels in a neighbourhood Used to partition images into regions of interest and to classify those regions cannot be defined for a point For example, an image has a 50% black and 50% white distribution of pixels pixels. Three different images with the same intensity distribution, but with different textures.

TextureFeatures Texture Features


Amajorproblemisthattexturesintherealworld j p areoftennotuniform,duetochangesin orientation,scaleorothervisualappearance. To describe a texture we can use as feature a Todescribeatexture,wecanuseasfeaturea mathematicalmeasureof: fine or coarse ? fineorcoarse? smoothorrough? homogeneousorinhomogeneous? homogeneous or inhomogeneous ? spatialstructure,orientation, , contrast,etc

TextureMeasurementorAnalysis Texture Measurement or Analysis


There are three common ways of analyzing Therearethreecommonwaysofanalyzing texture: Statistical Approaches StatisticalApproaches StructuralApproaches Spectral Approaches SpectralApproaches Texturesmayberandom,butwithcertain consistentproperties,oneobviouswayto consistent properties one obvious way to describesuchtexturesisthroughtheir statisticalproperties statistical properties

StatisticalApproaches
M MomentsofIntensity:FirstOrderStatistics t f I t it Fi t O d St ti ti Themostwellknowneasiestfirstorderstatistics isthehistogram:

Disadvantage: onlypixelintensitiesare represented,nospatialinteraction:meanhow intesities aredistributedoverimagespace

MomentsofIntensity:FirstOrder Statistics
Supposethatweconstructthehistogramofthe intensities inaregion.Wecanthencomputemomentsofthe1D histogram: Thefirstmomentisthemeanintensity Th fi t t i th i t it Thesecondcentralmomentisthevariance,which describeshowsimilartheintensitiesarewithinthe describes how similar the intensities are within the region. Thethirdcentralmoment,skew,describedhow symmetrictheintensitydistributionisaboutthemean. Thefourthcentralmoment,kirtosis,describeshow flatthedistributionis. flat the distribution is

Secondorderstatistic
Secondorderstatisticsconsiderpixelsinpairs. considertherelationshipbetweengroupsoftwo (usuallyneighboring)pixelsintheoriginalimage Hence,itrepresentsbilateralspatialinteractions. Itdependson2moreparameters: d:relativedistancebetweenpixels. :relativeorientationbetweenpixels. Forcomputationalreasons,isdiscretized,for examplein4regionsaround(0,45,90,135). Thismeansthepixelpairsmaybeobserved diagonally,verticallyinpixelspaceorimagespace

Gray Level Co-occurrence: Secondorderstatistic Second order statistic


GrayLevelC0occuranceissecondorderstatistic y measurementthatcontainsinformationaboutthe positionsofpixelshavingsimilargraylevelvalues. Itisatwodimensionalarray,P,inwhichboththe d l h hb h h rowsandthecolumnsrepresentasetofpossible imagevalues. image values.

AGLCM Pd[i,j]isdefinedbyfirstspecifyinga displacementvectord (dx,dy)andcounting displacement vector d=(dx,dy) and counting allpairsofpixelsseparatedbydhavinggray levelsi andj.

GLCM
GLCMtextureconsiderstherelationbetweentwopixels atatime,calledthe reference andthe neighbour pixel. Intheillustrationbelow,theneighbour pixelischosen tobetheonetotheeast(right)ofeachreferencepixel. ( g ) f f p Thiscanalsobeexpressedasa(1,0)relation:1pixelin thexdirection,0pixelsintheydirection.Means weare movingtowardseastwithonepixeldistancewithout g p anypixeldistanceinydirection. Eachpixelwithinthewindowbecomesthereference pixelinturn,startingintheupperleftcornerand pixel in turn starting in the upper left corner and proceedingtothelowerright.Pixelsalongtheright edgehavenorighthandneighbor,sotheyarenot usedforthiscount. used for this count

ConstructingGLCM Constructing GLCM


The Construction of GLCM matrix involves following main four steps.
Pairing the Pixels Constructing Pixel Framework Making S M ki Symmetric M t i t i Matrix Normalization of the Matrix Pairing the Pixels GLCM texture considers the relation between two pixels at a time, The pixel pair is called as reference and neighbor pixel. In figure shown The neighbor pixel is chosen to be the one to g g p the east (right) of each reference pixel. This can also be expressed as a (1,0) relation: 1 pixel in the x direction, 0 pixels in the y direction.

PairingthePixels Pairing the Pixels


GivenImage: PixelPairing: g
Combinationsofthegreylevelsthatarepossiblefor thetestimage,andtheirpositioninthematrix.

ConstructingFramework Constructing Framework


Twice in the test image the reference pixel is 0 and its eastern g p neighbor is also 0. i.e. the combination (0,0) has appeared twice. so is the combination of pixel (0,1). Three times the reference pixel is 2 and its neighbor is also 2 2.

Makingthematrixsymmetricalaroundthediagonal g y g

Taking the transpose of the GLCM make it TakingthetransposeoftheGLCMmakeit symmetric. Normalization of GLCM NormalizationofGLCM
Means expressing the elements of GLCM in probability. After making the GLCM symmetrical, there is still one step to take before texture measures can be calculated. The measures require that each GLCM cell contain not a count, but rather a probability. probability Probability :the number of times an outcome occurs, divided y fp by the total number of possible outcomes."

NormalizationoftheGLCM Normalization of the GLCM

Vii,jj is the value of the GLCM at cell i j isthevalueoftheGLCMatcelli,j

Exercise
Exercise:Usethetestimageandasouthspatial
relationshipwithreferencepixelandtheneighborbelowit. Testimage FindPixelPairing

NormalizedMatrix

Symmetricalmatrix S ti l ti

ThingstoNoteaboutNormalizedSymmetricalGLCM
Th di Thediagonalelementsallrepresentpixelpairswithnogreylevel l l ll i l i ih l l difference (00,11,22,33etc.). Iftherearehighprobabilitiesintheseelements,thentheimage doesnotshowmuchcontrast:mostpixelsareidentical totheir neighbors. When values in the diagonal are summed, the result is the Whenvaluesinthediagonalaresummed,theresultisthe probabilityofany pixel'sbeingthesamegreylevelasitsneighbor. Cellsonecellawayfromthediagonalrepresentpixelpairswitha differenceofonlyonegreylevel(01,12,23etc.).Similarly,values difference of only one grey level (0 1 1 2 2 3 etc ) Similarly values incellstwoawayfromthediagonalshowhowmanypixelshave2 greyleveldifferences,andsoforth.Thefartherawayfromthe diagonal,thegreaterthedifferencebetweenpixelgreylevels. di l th t th diff b t i l l l Sumuptheseparalleldiagonalsandtheresultistheprobabilityof any pixel'sbeing1or2or3etc.differentfromitsneighbour

Summaryofstepsincreatingasymmetricalnormalized y p g y GLCM: Createaframeworkmatrix Decideonthespatialrelationbetweenthereference andneighborpixel Count the occurrences and fill in the framework matrix Counttheoccurrencesandfillintheframeworkmatrix Addthematrixtoitstransposetomakeitsymmetrical Normalize the matrix to turn it into probabilities. Normalizethematrixtoturnitintoprobabilities.

PropertiesoftheGLCM
CONTRASTGROUP:Howmuchpixelvalueissametoitsneighbor Contrast Dissimilarity Homogeneity ORDERLINESSGROUP(Howmuchorderness liesinthepixelarrangement)
AngularSecondMoment(ASM) Energy Entropy(ENT) MaximumProbability(MAX)

STATSGROUPDescriptiveStatisticsontheGLCMatrix p
GLCMMean, GLCMVariance(orStandardDeviation)and GLCMCorrelation.

ContrastGroup Contrast Group


Measuresrelatedtocontrastuseweightsrelatedtothedistance fromtheGLCMdiagonal. f th GLCM di l ValuesontheGLCMdiagonalshownocontrast,andcontrast increasesawayfromthediagonal Contrast: Contrast: Wheni andjareequal,thecellisonthediagonaland(ij)=0.These valuesrepresentpixelsentirelysimilartotheirneighbor,sotheyare values represent pixels entirely similar to their neighbor so they are givenaweightof0. Ifi andjdifferby1,thereisasmallcontrast,andtheweightis1. If i and j differ by 2 contrast is increasing and the weight is 4 Ifi andjdifferby2,contrastisincreasingandtheweightis4. Theweightscontinuetoincreaseexponentiallyas(ij)increases

Example

Whatisthedegreeofthismeasure? Seconddegree Exercise:CalculatetheContrastfortheverticalGLCMandcompareitwiththeContrast forthehorizontalGLCM

Dissimilarity(DIS)
IntheContrastmeasure, weightsincreaseexponentially(0,1,4,9, etc.)asonemovesawayfromthediagonal.Howeverinthe dissimilaritymeasureweightsincreaselinearly(0,1,2,3 etc.).

TryouttheDissimilaritycalculationforthehorizontalimageand comparethevaluewithContrastforthesamematrix: p

VerticalDissimilarityis0.664;verticalContrastis0.996.Contrastgivesahigher numberthandoesDissimilarity,whichisasexpectedsinceContrastweightsare larger

Homogeneity (HOM) (alsocalledthe "InverseDifferenceMoment") HomogeneityweightsvaluesbytheinverseoftheContrastweight,with weightsdecreasingexponentiallyawayfromthediagonal weights decreasing exponentially away from the diagonal

CalculatethehomogeneityvalueforthehorizontalGLCMandcompareitwiththe C l l h h i l f h h i l GLCM d i ih h Dissimilarityvalue.

Measureoforderness
Orderlinessmeasures,likecontrast,useaweightedaverageofthe GLCMvalues.Theweightisconstructedrelatedtohowmanytimes agivenpairoccurs.
Aweightthatincreaseswithcommonnesswillyieldatexturemeasure thatincreaseswithorderliness. Aweightthatdecreaseswithcommonnessyieldsatexturemeasurethat eg a dec eases co o ess y e ds a e u e easu e a increaseswithdisorder

Inthemoreorderlyimageontheleft,eachpairofvalues occursmanytimes:2isnextto1fourtimes,3isnextto2 ti 2i tt 1f ti 3i tt 2 fourtimes,etc.Forthelessorderlyimage,combinations occurlessoften:2isnextto1onlyonce,3nextto2 y , threetimes,andsoon.

ASMandEnergy ASM and Energy

ExerciseonASMandenergy Exercise on ASM and energy


Themaximumvalueof1foreitherASMorEnergyoccurswhenallpixelsin theimageareidentical.QuicklydrawtheGLCMforthissituationand performtheASMcalculation. Solution: Letssupposewehave3levelimage0,1,2,3allhavingsamevalueandlets sayitsequalto2.i.e. CalculateGLCM: Step1.pairingpixel

ExerciseonASMandenergy gy

Calculating the pixel framework let say A= CalculatingthepixelframeworkletsayA=

symmetric=A+A=

GLCM=A+A/sum(A+A)=
ASM:1 1=1 ASM: 1*1 = 1

ASMcalculation
PerformtheASMcalculationforthehorizontal GLCM:

Entropy
UsingtheequationcalculatetheEntropyofthehorizontalGLCM

DescriptiveStatisticsontheGLC Matrix

VarianceCalculationforGLCM Variance Calculation for GLCM

GLCMCorrelation GLCM Correlation


TheCorrelationtexturemeasuresthelineardependency e o e a o e u e easu es e ea depe de cy ofgreylevelsonthoseofneighbouring pixels.GLCM Correlationisquiteadifferentcalculationfromtheother texturemeasuresdescribedabove.Asaresult,itis d ib d b A l i i independent ofthem(givesdifferentinformation)and canoftenbeusedprofitablyincombinationwithanother can often be used profitably in combination with another texturemeasure.Italsohasamoreintuitivemeaningto theactualcalculatedvalues:0isuncorrelated,1is perfectlycorrelated.

CorrelationCalculation
Exercise: CalculatetheGLCM Correlationmeasureforthehorizontal testimage. g

You might also like