Texture Analysis - Purdue University

Transcription

Texture AnalysisMichael A. Wirth, Ph.D.University of GuelphComputing and Information ScienceImage Processing Group 2004

What is Texture? Texture is a feature used to partition imagesinto regions of interest and to classify thoseregions. Texture provides information in the spatialarrangement of colours or intensities in animage. Texture is characterized by the spatialdistribution of intensity levels in aneighborhood.2

What is Texture? Texture is a repeating pattern of localvariations in image intensity:– Texture cannot be defined for a point.3

What is Texture? For example, an image has a 50% black and50% white distribution of pixels. Three different images with the sameintensity distribution, but with differenttextures.4

Texture Texture consists of texture primitives ortexture elements, sometimes called texels.– Texture can be described as fine, coarse, grained,smooth, etc.– Such features are found in the tone and structureof a texture.– Tone is based on pixel intensity properties in thetexel, whilst structure represents the spatialrelationship between texels.5

Texture– If texels are small and tonal differences betweentexels are large a fine texture results.– If texels are large and consist of several pixels, acoarse texture results.6

Texture Analysis There are two primary issues in textureanalysis:n texture classificationo texture segmentation Texture segmentation is concerned withautomatically determining the boundariesbetween various texture regions in an image. Reed, T.R. and J.M.H. Dubuf, CVGIP: Image Understanding, 57: pp.359-372. 1993.7

Texture Classification Texture classification is concerned withidentifying a given textured region from agiven set of texture classes.– Each of these regions has unique texturecharacteristics.– Statistical methods are extensively used.e.g. GLCM, contrast, entropy, homogeneity8

Defining Texture There are three approaches to definingexactly what texture is:c Structural: texture is a set of primitive texels insome regular or repeated relationship.d Statistical: texture is a quantitative measure of thearrangement of intensities in a region. This set ofmeasurements is called a feature vector.e Modelling: texture modelling techniques involveconstructing models to specify textures.9

Defining Texture Statistical methods are particularly usefulwhen the texture primitives are small,resulting in microtextures. When the size of the texture primitive is large,first determine the shape and properties ofthe basic primitive and the rules which governthe placement of these primitives, formingmacrotextures.10

Simple Analysis of Texture11

Range One of the simplest of the textureoperators is the range ordifference between maximum andminimum intensity values in aneighborhood.– The range operator converts theoriginal image to one in whichbrightness represents texture.12

Variance Another estimator of texture isthe variance in neighborhoodregions.– This is the sum of the squares ofthe differences between theintensity of the central pixel and itsneighbours.13

Quantitative Texture Measures Numeric quantities or statistics that describea texture can be calculated from theintensities (or colours) themselves14

Grey Level Co-occurrence The statistical measures described so far areeasy to calculate, but do not provide anyinformation about the repeating nature oftexture. A gray level co-occurrence matrix (GLCM)contains information about the positions ofpixels having similar gray level values.15

GLCM A co-occurrence matrix is a two-dimensionalarray, P, in which both the rows and thecolumns represent a set of possible imagevalues.– A GLCM Pd[i,j] is defined by first specifying adisplacement vector d (dx,dy) and counting allpairs of pixels separated by d having gray levels iand j.Pd [i , j ] nij– The GLCM is defined by:16

GLCM– where nij is the number of occurrences of the pixelvalues (i,j) lying at distance d in the image.– The co-occurrence matrix Pd has dimension n n,where n is the number of gray levels in the image.17

GLCM For example, if d (1,1)2 1 2 0 10 2 1 1 20 1 2 2 01 2 2 0 12 0 1 0 1ij0 2 20Pd 2 1 22 3 2101i22jthere are 16 pairs of pixels in the imagewhich satisfy this spatial separation. Sincethere are only three gray levels, P[i,j] is a 3 3matrix.18

GLCMAlgorithm: Count all pairs of pixels in which the first pixelhas a value i, and its matching pair displacedfrom the first pixel by d has a value of j. This count is entered in the ith row and jthcolumn of the matrix Pd[i,j] Note that Pd[i,j] is not symmetric, since thenumber of pairs of pixels having gray levels[i,j] does not necessarily equal the number ofpixel pairs having gray levels [j,i].19

Normalised GLCM The elements of Pd[i,j] can be normalised bydividing each entry by the total number ofpixel pairs.Normalised GLCM; N[i,j], defined by:P [i , j ]N [i , j ] P [i, j ]ijwhich normalises the co-occurrence values tolie between 0 and 1, and allows them to bethought of as probabilities.20

Numeric Features of GLCM Gray level co-occurrence matrices captureproperties of a texture but they are notdirectly useful for further analysis, such as thecomparison of two textures. Numeric features are computed from the cooccurrence matrix that can be used torepresent the texture more compactly.21

Maximum Probability This is simply the largest entry in the matrix,and corresponds to the strongest response.– This could be the maximum in any of the matricesor the maximum overall.Cm max Pd [i , j ]i, j22

Maximum Probability Maximum probability with w 21, and d (2,2)23

Moments The order k element difference moment canbe defined as:Momk (i j )k Pd [i , j ]ij This descriptor has small values in caseswhere the largest elements in P are along theprincipal diagonal. The opposite effect can beachieved using the inverse moment.Pd [i , j ]Momk ,i jkij (i j )24

Moments Moments with w 21, and d (2,2)25

Contrast Contrast is a measure of the local variationspresent in an image.C(k , n ) (i j ) Pd [i , j ]kinj– If there is a large amount of variation in an imagethe P[i,j]’s will be concentrated away from themain diagonal and contrast will be high.– (typically k 2, n 1)26

Contrast Contrast with w 21, and d (2,2)27

Homogeneity A homogeneous image will result in a cooccurrence matrix with a combination of highand low P[i,j]’s.Pd [i , j ]Ch ij 1 i j– Where the range of graylevels is small the P[i,j]will tend to be clustered around the main diagonal.– A heterogeneous image will result in an evenspread of P[i,j]’s.28

Homogeneity Homogeneity with w 21, and d (2,2)29

Entropy Entropy is a measure of information content.It measures the randomness of intensitydistribution.Ce Pd [i , j ]ln Pd [i , j ]ij– Such a matrix corresponds to an image in whichthere are no preferred graylevel pairs for thedistance vector d.– Entropy is highest when all entries in P[i,j] are ofsimilar magnitude, and small when the entries inP[i,j] are unequal.30

Entropy Entropy with w 21, and d (2,2)31

Correlation Correlation is a measure of image linearity [ijP [i, j ]] µ µdCc iijjσ iσ jµi iPd [i , j ], σ i2 i 2 Pd [i , j ] µi2 Correlation will be high if an image contains aconsiderable amount of linear structure.32

GLCM - References Carlson, G.E. and W.J. Ebel. "Co-occurrence matrix modification forsmall region texture measurement and comparison". in IGARSS'88Remote Sensing: Moving Towards the 21st Century, pp.519-520, IEEE,Edinburgh, Scotland. 1988.Argenti, F., L. Alparone, and G. Benelli, "Fast algorithms for textureanalysis using co-occurrence matrices". IEE Proceedings, Part F:Radar and SIgnal Processing, 137(6): pp. 443-448. 1990.Gotlieb, C.C. and H.E. Kreyszig, "textur descriptors based on cooccurrence matrices". Computer Vision, Graphics and ImageProcessing, 51(1): pp. 70-86. 1990.33

Problems with GLCM One problem with deriving texturemeasures from co-occurrence matricesis how to choose the displacementvector d.– The choice of the displacement vector is an important parameter in thedefinition of the GLCM.– Occasionally the GLCM is computed from several values of d and the onewhich maximises a statistical measure computed from P[i,j] is used.– Zucker and Terzopoulos used a χ2 measure to select the values of d thathave the most structure; i.e. to maximise2 the value:Pd [i , j ]χ (d ) 1ij Pd [ i ]Pd [ j ]234

Windowing Algorithms for texture analysis are applied toan image in a series of windows of size w,each centered on a pixel (i,j).– The value of the resulting statistical measure areassigned to the position (i,j) in the new pixel.35

Haralick Texture Operator Haralick et al. suggested a set of 14 texturalfeatures which can be extracted from the cooccurrence matrix, and which containinformation about image texturalcharacteristics such as homogeneity,linearity, and contrast. Haralick, R.M., K. Shanmugam, and I. Dinstein, "Textural features forimage classification". IEEE Transactions on Systems, Man andCybernetics: pp. 610-621. 1973.36

Graylevel Difference Statistics Grey-level differences are based on absoutedifferences between pairs of grey-levels. The grey-level differences are contained in a256-element vector, and are computed bytaking the absolute differences of all possiblepairs of grey levels distance d apart at angleθ, and counting the number of times thedifference is 0,1, ,25537

Graylevel Difference Statistics Let d (dx,dy) be the displacement vectorbetween two image pixels, and g(d) the graylevel difference at distance d.g (d ) f (i , j ) f (i dx, j dy ) pg(g,d) is the histogram of the gray-leveldifferences at the specific distance, d. Onedistinct histogram exists for each distance d.38

Graylevel Difference Statistics The difference statistics are then normalizedby dividing each element of the vector by thenumber of possible pixel pairs. Several texture measures can be extractedfrom the histogram of graylevel differences:39

Graylevel Difference Statistics Mean:Nµd g k pg (g k , d )k 1– Small mean values µd indicate coarse texturehaving a grain size equal to or larger than themagnitude of the displacement vector. Entropy:NHd pg (g k , d )ln pg (g k , d )k 1– This is a measure of the homogeneity of thehistogram. It is maximised for uniform histograms.40

Graylevel Difference Statistics Variance:Nσ d2 (g k µd )2 pg (g k , d )k 1– The variance is a measure of the dispersion of thegray-level differences at a certain distance, d. Contrast:NCd g k2 pg (g k , d )k 141

Graylevel Difference StatisticsMeanStandard DeviationEntropyContrast42

Runlength Statistics The lengths of texture primitives in differentdirections can serve as a texture description.– A run length is a set of constant intensity pixelslocated in a line. Runlength statistics are calculated bycounting the number of runs of a given length(from 1 to n) for each grey level. Galloway, M.M., "Texture classification using gray level run lengths".Computer Graphics and Image Processing, 4(2): pp. 172-179. 1975.43

Runlength Statistics In a course texture it is expected that longruns will occur relatively often, whereas a finetexture will contain a higher proportion ofshort runs. Statistical measures:– Let B(a,r) be the number of primitives of alldirections having length r, and grey-level a, m andn the image dimensions, and L the LnumberofNrintensity values.K B(a, r )a 1 r 1– Let K be the number of runs:44

Runlength Statisticsc Long-run emphasis:Slr L1KNr2B(a,r)r a 1 r 1– This is a measure that emphasizes the long-runs of a graylevel image. Long-run emphasis will be large when there arelots of long runs of the same intensity.d Short-run emphasis: Ssr B(a, r ) 2ra 1 r 1L1KNr– This is a measure that emphasizes the short-runs of a graylevel image. short-run emphasis will be large whenthere are lots of short runs of the same intensity.45

Runlength Statisticse Grey-level distribution:Sd 2 B(a, r )r a 1 r 1 L1KNr2– The sum in [ ] gives the total number of runs for a certaingray-level value grey-level a. The distribution will be largewhen runs are not evenly distributed over the differentintensities.46

Runlength Statisticsf Run-length distribution:Srd 2 B(a, r )r r 1 a 1 Nr1KL2– The sum in [ ] gives the total number of occurrences of acertain run length l for any gray level. s for a certain graylevel value grey-level r.g Run percentage:KSrp mn47

Edges and Texture It should be possible to locate the edges that resultfrom the intensity transitions along the boundary ofthe texture.– Since a texture will have large numbers of texels, thereshould be a property of the edge pixels that can be used tocharacterise the texture. a set of common directions a measure of the locadensity of the edge pixels Compute the co-occurrence matrix of an edgeenhanced image. Davis, L.S. and A. Mitiche, "Edge detection in textures". ComputerGraphics and Image Processing, 12: pp. 25-39. 1980.48

Edges and TextureOriginalSobel-EnhancedContrast49

Energy and Texture One approach to generating texture featuresis to use local kernels to detect various typesof texture. Laws† developed a texture-energy approachthat measures the amount of variation withina fixed-size window. Laws, K.I. "Rapid texture identification". in SPIE Image Processing forMissile Guidance, pp.376-380. 1980.†50

Laws A set of convolution kernels are used tocompute texture energy. The kernels are computed from the followingvectors:L5 [1 4 6 4 1]E5 [ 1 2 0 2 1]S5 [ 1 0 2 0 1]R5 [1 4 6 4 1]W5 [ 1 2 0 2 1]51

Laws The L5 (level) vector gives a centre-weightedlocal average. The E5 (edge) vector detectsedges, the S5 (spot) vector detects spots, theR5 (ripple) vector detects ripples, and the W5(wave) vector detects waves. The two-dimensional convolution kernels areobtained by computing the outer product of apair of vectors.52

Lawse.g. E5L5 is computed as the product of E5and L5 as follows: 1 2 0 [1 4 6 4 1] 2 1 1 4 6 4 1 2 8 12 8 2 0 00 0 0 281282 1 46 41 This results in 25 5 5 kernels, 24 of thekernels are zero-sum, the L5L5 is not.53

E5L5R5S5W5E5L5R554

E5L5R5S5W5S5W555

Laws Bias from the “directionality” of textures canbe removed by combining symmetric pairs offeatures, making them rotationally invariant.e.g. S5L5(H) L5S5(V) L5S5R56

LawsL5S5S5L5 57

Laws After the colvolution with the specified kernel,the texture energy measure (TEM) iscomputed by summing the absolute values ina local neghborhood:mnLe C (i , j )i 1 j 1 If n kernels are applied, the result is an ndimensional feature vector at each pixel ofthe image being analysed.58

LawsALGORITHM: (1) Apply convolution kernels(2) Calculate the texture energy measure(TEM) at each pixel. This is achieved bysumming the absolute values in a localneighborhood.(3) Normalise features - use L5L5 tonormalisethe TEM images59

Fractal Dimension Fractal geometry can be used to discriminatebetween textures. The fractal dimension D of a set of pixels I isspecified by the relationship:1 Nr Dwhere the image I has been broken up into Noverlapping copies of a basic shape, each one scaledby a factor, r. Russ, J.C., "Surface characterisation: Fractal dimensions, Hurstcoefficients, and frequency transforms". Journal of Computer AssistedMicroscopy, 2: pp. 249-257. 1990.60

Fractal Dimension D can be estimated by the Hurst coefficient:log ND log( 1r ) There is a Log-Log relationship between Nand r. If log(N) were plotted against log(r) theresult should be a straight line whose slope isapproximately D.61

Hurst The Hurst-coefficient is an approximation thatmakes use of this relationship.– Consider a 7 7 pixel region which is marked according tothe distance of each pixel from the central pixel.– There are eight groups of pixels, corresponding to the eightdifference distances that are possibleCentral pixel (d 0)Distance sqrt(5)Distance 1Distance sqrt(8)Distance sqrt(2)Distance 3Distance 2Distance sqrt(10)62

Hurst– Within each group, the largest difference inintensity is found, this is the same as subtractingthe minimum value from the maximum value.– The central pixel is ignored, and a straight line isfitted to the Log of the maximum difference (ycoord), and the Log og the distance from thecentral pixel (x-coord).– The slope of this line is the Hurst coefficient, andreplaces the pixel at the centre of the region.63

Hurst8570869260 102 20291 81 98 113 86 119 18996 86 102 107 74 107 194101 91 113 107 83 118 19899 68 107 107 76 107 194107 94 93 115 83 115 19894 98 98 107 81 115 194DistanceDifferenceLog(dis)Log(dif)d 1 d 2300.0d 239d 44550d d 3d 105113013880.3470.6930.8051.041.0991.1513.401 3.6643.7843.9123.9324.8684.927y 1.145 x 3.229 The slope of the line, m 1.145 is the Hurstcoefficient64

Hurst65

Surfaces and Texture There are some algorithms that are based ona view of the gray-level image as a threedimensional surface, where intensity is thethird dimension.– Vector dispersion Matalas, I., S. Roberts, and H. Hatzakis. "A set ofmultiresolution texture features suitable for unsupervisedimage segmentation". in SIgnal Processing VIII: Theoriesand Applications. 1996.– Surface curvature Peet, F.G. and T.S. Sahota, "Surface curvature as a measureof image texture". IEEE Transactions on Pattern Analysis andMachine Intelligence, 7(6): pp. 734-738. 1985.66

Model-based Methods Model-based methods for texture analysis isan approach used to characterize texturewhich determines an analytical model of thetextured image being analyzed.– Such models have a set of parameters.– The values of these parameters determine theproperties of the texture, which may besynthesized by applying the model.e.g. Markov random fields67

Model-based Methods Markov Random Fields (MRF) have beenextensively studied as a model for texture. In the discrete Gauss-Markov random fieldmodel, the gray level at any pixel is modeledas a linear combination of gray levels of itsneighbors plus an additive noise, as definedby:f (i , j ) f (i k , j l ) h(k , l ) n(i , j )k ,l68

Model-based Methods– The summation is carried out over a specified setof pixels which are neighbors to the pixel (i,j)– The parameters of this model are the weightsh(k,l).– These parameters are computed from the giventexture using least-squares method.– These estimated parameters are then comparedwith those of the known texture class to determinethe class of the particular texture being analysed.69

Texture Segmentation Any texture measure that provides a value, ora vector of values at each pixel, describingthe texture in a neighborhood of that pixel canbe used to segment an image into regions ofsimilar textures. There are two major categories:c Region-based: attempt to group or cluster pixelswith similar texture propertiesd Boundary-based: attempt to find “texture-edges”between pixels from different texture distributions70

Texture SegmentationGLC: Entropy(Wsize 13)Original T 4Entropy T 12Breast ContourApproximation71

Grey-level differences are based on absoute differences between pairs of grey-levels. The grey-level differences are contained in a 256-element vector, and are computed by taking the absolute differences of all possible pairs of grey levels distance d apart at angle θ, and counting the number of times the difference is 0,1, ,255