Professional Documents
Culture Documents
Texture Recognition
In partial fulfillment of the Requirements for CMP605 Image Processing and Computer Vision
Presented by
May 2012
Contents
Abstract ...................................................................................................................................... 4 Acknowledgement ...................................................................................................................... 4 Chapter 1: Introduction ............................................................................................................... 5 1.1 Motivation and Justification ......................................................................................... 5
Applications......................................................................................................................... 5 1.2 Problem Definition ............................................................................................................ 5 1.3 Summary of Approach ....................................................................................................... 8 1.4. Report Overview............................................................................................................... 8 Chapter 2: Literature Survey........................................................................................................ 9 Model-based Approaches [3,11,15] ......................................................................................... 9 Statistical Approaches [3] ...................................................................................................... 11 Structural Approach [3] ......................................................................................................... 14 Transform Methods............................................................................................................... 14 Chapter 3: Necessary Background ............................................................................................. 16 Wavelet Transform................................................................................................................ 16 Singular Value Decomposition ............................................................................................... 20 Chapter 4: System Description .................................................................................................. 21 Selected Approaches ............................................................................................................. 21 Declined Approaches............................................................................................................. 21 System Block Diagram ........................................................................................................... 21 Histogram and GLCM Statistics .............................................................................................. 22 Laws Masks .......................................................................................................................... 23 Wavelet Decomposition ........................................................................................................ 24 Curvelet Decomposition ........................................................................................................ 24 Gabor Filter Bank .................................................................................................................. 24 Singular Value Decomposition ............................................................................................... 24 Classifiers .............................................................................................................................. 25 Classifier Fusion [9] ............................................................................................................... 25
Chapter 5: Results ..................................................................................................................... 27 Histogram and GLCM Statistics .............................................................................................. 27 Laws Masks .......................................................................................................................... 28 Wavelet Decomposition ........................................................................................................ 28 Curvelet Decomposition ........................................................................................................ 29 Gabor Filter Feature .............................................................................................................. 29 Singular Value Decomposition ............................................................................................... 30 Fusion Results ....................................................................................................................... 31 Chapter 6: Conclusion and future work. .................................................................................... 32 Conclusions ........................................................................................................................... 32 Future Work .......................................................................................................................... 32 References ................................................................................................................................ 33 Appendix A. Development Tools and Environment .................................................................... 34 Used Toolboxes and Functions .............................................................................................. 34 Appendix B. Sample MATLAB Functions and Scripts................................................................... 35 FeatureExtract Function ........................................................................................................ 35 Wavelet Feature Function ..................................................................................................... 36 SVD Feature .......................................................................................................................... 37
Abstract
Image texture, defined as a function of the spatial variation in pixel intensities (gray values), is useful in a variety of applications and has been a subject of intense study by many researchers. One immediate application of image texture is the recognition of image regions using texture properties. Texture is the most important visual cue in identifying these types of homogeneous regions. This project is concerned with exploiting various texture analysis techniques. Existing techniques are classified and implemented for comparison purposes. A proposed technique Singular Value Decomposition is examined and compared with the existing. Finally, we sugges t some possible future work in this field. This technique give a good spatial representation that differs from the other techniques and therefore useful in decision fusion. We are classifying between 20 textures, each texture has 40 samples [1], 30 are used for training and 10 for testing. Implementation is done using MATLAB. The highest recognition rate achieved using a single feature is 82% and the highest accuracy using fusion techniques is 93%.
Acknowledgement
We thank Dr. Ahmed for his well guided self-study course and outlined project, from which we have gained significant experience.
Chapter 1: Introduction
1.1 Motivation and Justification
Texture analysis techniques are not only used with textures by its strict meaning, many of the computer vision applications encounter textures by its descriptive meaning. Although, there are many definitions given for a texture in computer vision, we found the following to be the most relevant: A region in an image has a constant texture if a set of local statistics or other local properties of the picture function are constant, slowly varying, or approximately periodic. So, we thought exploiting the various techniques for textural analysis will be a good experience and increase the benefit from the course, given the fact we have no prior knowledge of the problem. Applications Areas of application are endless. In some of the mature domains (such as remote sensing) texture already has played a major role, while in other fields (such as surface inspection) new applications of texture are being found. Texture analysis can be also used in automated inspection, medical image processing, document processing.
Analysis
Classification
Resizing Equaliztion
Feature Extraction
The input to the above system is the raw grayscale images and the output is the class recognized class (in the recognition phase). A final stage is added to fuse the decision of various classifiers to improve the recognition rate.
We shall now discuss the concept on which each of them is based and give various example approaches for each.
1
Where fs is image intensity at site s, es denotes an independent and identically distributed noise, Ns is a neighborhood of s and is a vector of model parameters. Causal AR models have an advantage of simplicity and efficiency in parameter estimation.
Markov Random Fields Model [3,15] A Markov random field (MRF) is a probabilistic process in which all interactions are local; the probability that a cell is in a given state is entirely determined by probabilities for states of neighboring cells. Let S be a set of locations, here for simplicity, assume S a grid. S={ (i, j) | i, j are integers }. Neighbours of s(i,j) ||S are defined as: ((i, j)) = { (k, l) | 0<(k - i)2 + (l - j)2 < r constant } A subset C of S is a clique if any two different elements of C are neighbours. Example of 8-neighborhood (r = 2):
Direct interaction occurs only between immediate neighbors. However, global effects can still occur as a result of propagation. Fractal Model [11,14] Its used with natural surfaces that have a statistical quality of roughness and self-similarity at different scales. If the size of the measuring tool is taken as , the measured quantity will be
3
Where D is known as the fractal dimension which Fractal model depends on. Then FD can be defined as: FD= log (Nr)/log(r -1)
Where Nr is the number of non-overlapping copies of a set similar to the original set, scaled down by a ratio r. But fractal dimension is not sufficient to capture all textural properties, that there may be perceptually very different textures that have very similar fractal dimensions.
Another measure, called lacunarity , has been suggested in order to capture the textural property that will let one distinguish between such textures.
For example, consider the following 4*4 image containing 3 different grey values and Displacement vector d = (1, 0) 1100 1100 0022 0022 Pd = 402 220 002
Note: Different authors define the co-occurrence matrix a little differently in two ways: By defining the relationship operator p by an angle and distance d, and By ignoring the direction of the position operator and considering only the (bidirectional) relative relationship Features that can be used with this method are:
x and y are the means, x and y are the standard deviations of Pd(x) and Pd(y)
Laws Energy Filters [2] This method involved the application of simple filters to digital images. The basic filters used were common Gaussian, edge detector and Laplacian-type filters, and were designed to highlight points of high texture energy in the image. By identifying these high energy points, smoothing the various filtered images characterizes textures efficiently. The Laws masks are constructed by convolving together just three basic 1x3 masks:
5
The initial letters of these masks indicate Local averaging, Edge detection and Spot detection. In fact, these basic masks span the entire 1x3 subspace and form a complete set. Similarly, the 1x5 masks obtained by convolving pairs of these 1x3 masks together form a complete set.
Where R5 is Ripple detection and W5 is Wave detection mask. 2D masks can be obtained by outer product of pairs of the above masks. Masks that dont average to zero are not used because they are more sensitive to image intensity than the texture itself. The filtered images are then averaged over larger moving windows to get macro-features of the texture. The average is the absolute sum of all elements in a given window of size (2p+1)x(2p+1).
7
Second level feature extraction can be in the form of statistical measures for the energy matrix.
Transform Methods
Wavelet Decomposition [4,5] The texture image is decomposed using any type of wavelets up to a certain level of decomposition; producing 4 matrices at each layer from the decomposition of the blur of the previous layer (see the graphical interpretation and the wavelets section in ch.3 for further illustration). Various statistical measures of these resulting matrices are taken for each of the resulting layers. Examples of these statistics are the mean, standard deviation and the covariance. Graphical interpretation
LL: Low frequency information (Blur). HL: Horizontal high frequency component (vertical edges). LH: Vertical high frequency component (Horizontal edges). HH: Diagonal high frequency component (oblique edges).
Curvelet Transform [6] Curvelet transform is one of the modified wavelets families. The main difference is that curevelets have an orientation parameter in 2D and higher dimensional spaces. This orientation gives a more sparse representation for curved edges. Yet, this feature is not of significance in our task as there are no clear edge in most of the textures, besides various orientations in the scenery requires averaging over the various curvelet orientations causing some sort of blurring in a curved way.
Gabor Filter [5] Gabor filter is also one of wavelets families, but its main advantage is that it achieves minimum uncertainty between the time and frequency domain. Also, it has an orientation parameter like curvelets. The wavelet used has the form of a complex sinusoid modulated by a Gaussian window. Rotated Gaussian Oriented Complex Sinusoid
8 9
Statistics such as mean and standard deviation for each frequency and scale are calculated and averaged over the various orientations.
Wavelet Transform
Historical Motivation Fourier Transform FT decomposes a given signal in an orthogonal set of sinusoids of different frequencies.
10
Where xn is the signal in the time domain (TD) and Xk in the frequency domain (FD). These sinusoids have deterministic frequencies but extended throughout the whole time domain. Therefore lacks localization in the time (or space in 2D). Short-Time Fourier Transform (STFT) If we wish to gain some information on our location in the time (space) domain we can perform the FT on a window of the signal.
11
Where w[n] is the windowing function in time domain. A simple rectangular window corresponds to a sinc function in FD. Since multiplication in the TD corresponds to convolution in the FD this results in what is called leakage. The deltas of the frequencies are now wider. Therefore we are now limited by a certain resolution between the frequency and time domain. This resolution is fixed because the window size is fixed.
Multi-Resolution Analysis (Wavelets) Since STFT has fixed resolution we can use a variable size window to obtain various resolutions. This results in an over complete set such as the wavelets.
12 13
Where is the wavelet basis function, m is the scaling factor and n is the translation factor. The time frequency resolution can be interpreted as the following figure, as we get more localized in tine we lose localization in frequency and vice versa.
This is in contrast to the STFT which has fixed resolution that can be interpreted by the following figure
Various modifications to the original wavelets have arisen such as Curvelets, Ridigilets and Gabor filers.
Curvelet Transform This transformation was motivated by the fact that wavelets in 2D dont sparsely represent curved edges. So, the family of wavelets with an orientation parameter was devised to overcome such complication. The space frequency resolution map can be regarded as the following figure
This can be thought of as taking the time axis of the wavelets resolution map and rotating it towards the frequency axis clockwise, the above figure will be the result. Gabor Filter Gabor thought of this resolution problem as an analogous problem to the Heisenberg Uncertainty Principle and found that tf >= 1/(4). By seeking the equality he found that the wavelet that gives highest resolution in both time and frequency is a complex sinusoid modulated by a Gaussian window (as was shown in the literature survey).
First, we define the n singular values of A. These are the lengths of the n principal semiaxes of AS, written 1, 2 ... It is conventional to assume that the singular values are numbered in descending order. Next, we define the n left singular vectors of A These are the unit vectors {u1, u2} oriented in the directions of the principal semiaxes of AS, numbered to correspond with the singular values. Thus the vector iui is the ith largest principal semiaxis of AS. Finally, we define the n right singular vectors of A. These are the unit vectors {v1, v2...} S that are the pre-images of the principal semiaxes of AS, numbered so that Avj = juj This mathematical identity motivated the proposed techniques. As the singular values are thought to be characteristic for a given bases and matrix operating on it.
Declined Approaches
Model-based methods. Structural approaches.
Reasoning: The model-based and structural approaches are better used in synthesis than in recognition. The search for the parameters of an assumed model or a building unit along with a placement rule fails in case of natural textures, due to not only the variability in natural scenes but also the variability in the image acquisition view (zooming in and out, inclination and rotation).
Read Image
Pre-processing
Image Analysis
Classificaiton
Final Decision
We shall know describe the implementation procedure used for each approach and the implemented fusion techniques.
Laws Masks
Procedure 1. Form the required mask by outer product of the following masks:
2. 3. 4. 5. 6. 7.
Calculate the normalization image by convolving with L5L5. Convolve the zero-average 5x5 mask with the image and normalize. Average the convolved image using a 15x15 mask. Do the above steps using the reversed mask. E.g.: E5L5 and L5E5. Take the average of the final two images. Take five statistical parameters for the averaged image; mean, STD, skewness, kurtosis and entropy.
Wavelet Decomposition
Procedure [4] 1. Calculate up to the 3rd level Haar decomposition using MATLAB dwt2 command 3 times in succession on the blur. 2. Obtain the mean and STD of the final blur. 3. For each of the high frequency details at each level obtain the mean and STD.
Curvelet Decomposition
Procedure 1. Calculate the curvelet decomposition using the CurveLab Toolbox for MATLAB via warping. 2. For each level of decomposition take the average of the various angles. 3. Calculate the mean and STD for this average.
Classifiers
Classification is done using neural networks trained on the extracted features using the MATLAB nprtool.
Note: Although the above techniques enhance the recognition rate as will be shown in the results chapter, they are computationally expensive, especially the decision templates because it acts as a second training/classification phase. So using any of the mentioned techniques is actually a compromise between the required accuracy and the expense of lengthy calculations.
Chapter 5: Results
In this section we will be discussing the results of the previously mentioned techniques, highlighting the main classification errors that each feature causes.
Confusion The following three classes cause the main confusion. It is very obvious that the Granite and Bark have almost the same Histogram and GLCM distributions. But pebbles confuse with them as a result of the fact that we use neither the whole GLCM nor the Histogram for classification but rather statistics of each of them.
Granite
Bark
Pebbles
Laws Masks
Feature vector size: 70 Recognition rate 79 % Confusion The main confusion is the Granite and Bark, the same as the GLCM and Histogram confusion. This also makes sense since both of these techniques belong to the same category.
Wavelet Decomposition
Feature vector size: 20. Recognition Rate 82 % Confusion Also, Granite and Bark are the main confusing classes, same as Statistical. But here the reasons differ; the high frequencies along the vertical and horizontal directions along with the blur of both classes are quite similar, not to mention their statistics of course. But the fact that wavelet feature shows better performance than the statistical methods is that the wavelet decompositions provide a better representation for the images information than the statistical features. Note: Although the wavelet feature shows better performance, yet it has higher dimensionality than the statistical feature. The feature extraction phase of the WD is almost the same as the statistical methods, but in the classification phase the WD requires more calculations due to the higher dimensionality.
Curvelet Decomposition
Feature vector size: 20 Recognition Rate 73% Confusion Curvelets have an orientation control parameter that differs from the regular wavelets. To overcome the variation in scene rotations during feature extraction averaging is done on the various orientations at a certain level of decomposition. This averaging causes some sort of blurring or brushing in a curved way. This confuses the classifier between the Granite and Carpet classes mainly.
Granite
Carpet
Marble
Floor
Wood 1
Wood 2
Fusion Results
Used Classifiers: Laws, Statistical with 1,4 pixel distances Wavelets, Curvelets and Gabor. SVD. Recognition Rate for the Different Techniques Confidence: 84% Voting: 91.5% Decision templates: 93% The above results may vary when different combinations of the implemented classifiers are used. And as mentioned before these fusion techniques are computationally expensive, yet the increase in the recognition rate over the single classifier accuracy ranges from 2 - 11%.
Future Work
Searching for the optimum parameters (e.g. neighbor distance and orientation) for each analysis technique. As using the same parameters for all types of textures might not be the optimum solution. Decision fusion using different types of classifiers like K-Nearest Neighbor and Discriminant Function Analysis. Exploring texture analysis techniques when used with colored images. Expanding the analysis to motion textures.
References
[1] A Sparse Texture Representation Using Local Affine Regions, Svetlana Lazebnik, Cordelia Schmid, and Jean Ponce, IEEE Transactions on Pattern Analysis and Machine Intelligence. [2] Introduction to texture analysis, Machine vision group, physics dept. Royal Holloway, London. [3] Texture Analysis Methods A Review, Andrzej Materka and Michal Strzelecki, Technical University of Lodz, Institute of Electronics. [4] Improving Texture Recognition using Combined GLCM and Wavelet Features, Ranjan Parekh, School of Education Technology, Jadavpur University, Kolkata, India. [5] Brief review of invariant texture analysis methods, Jianguo Zhang, Tieniu Tan, National Laboratory of Pattern Recognition (NLPR), Institute of Automation, Chinese Academy of Sciences. [6] Content Based Image Retrieval Using Curvelet Transform, Ishrat Jahan Sumana, Md. Monirul Islam, Dengsheng Zhang and Guojun Lu, Gippsland School of Information Technology, Monash University, Churchill, Victoria 3842, Australia. [7] Texture Analysis, Mihran Tuceryan, Department of Computer and Information Science, Indiana University -Purdue University at Indianapolis, 723 W. Michigan St. Indianapolis, IN 46202-5132. [8] Laws masks descriptors applied to bone texture analysis: an innovative and discriminant tool in osteoporosis, M. Rachidi & A. Marchadier & C. Gadois & E. Lespessailles & C. Chappard & C. L. Benhamou. [9] Switching Between Selection and Fusion in Combining Classifiers: An Experiment, Ludmila I. Kuncheva. [10] Introduction to Texture Analysis, E. R. Davies, Machine Vision Group, Department of Physics Royal Holloway, University of London. [11] Chapter 5 Texture recognition, x Llad Bardera , Universitat de Girona. Departament d'Electrnica, Informtica i Automtica. [12] A comparative study of texture analysis algorithms in textile inspection applications, Ibarra Pico, Cuenca Asensi, Garca Crespi, Lorenzo Quintanilla, Morales Benavente, Universidad de Alicante, Departamento de Tecnologa Informtica y Computacin, Campus de San Vicente [13] A regularized simultaneous autoregressive model for texture classification, Yao-wei ,Yan-fei , Wen Yong ; 3 Institute of Computing Technology, Graduate School of Chinese Academy of Science. [14] Texture description using fractal energy features and energy features, t. kasparis, n. s. tzannes, m. ba~~iouni* and q. chen department of electrical and computer engineering and 2department of computer science, university of central florida, orlando, fl 32816, u.s.a. [15] Brief review of invariant texture analysis methods, Jianguo Zhang, Tieniu Tan, National Laboratory of Pattern Recognition (NLPR), Institute of Automation, Chinese Academy of Sciences, Beijing, Peoples Republic of China
counter = counter + 1; end %% Saving The Data TrainMat = [TrainCell{:}]; TestMat = [TestCell{:}]; save(OutFileName, 'TrainCell', 'TrainMat', 'TrainTargets', 'TestCell', 'TestMat', 'TestTargets'); % Feature Name of Saved Data end
SVD Feature
This function takes an image and returns a feature vector of size 125. Functions code
function v = SVDFeature(I) Id = double(I); ColDiv = 5; RowDiv = 5; [Row Col] = size(I); C = mat2cell(Id, Row/RowDiv*ones(1,RowDiv), Col/ColDiv*ones(1,RowDiv)); v = []; for i = 1:ColDiv for j = 1: RowDiv d = svd(C{i,j}); v = [ v; d(1:5) ]; end end end