You can either use Support Vector Machine(SVM) or Neural Networks. SVM is widely used and gives great results. An example of how you can use it in Matlab.
- First of all, you need to divide your data into 'Training' and 'Testing' set.
- 'Training' set is the one about which you know i.e. in your case you know which textures are defective and which are non-defective.
- 'Testing' set is the one on which you want to test your method of classification.
Lets say training
matrix contains the Gabor features of all training set images where each row corresponds to feature vector of an image (transposed column vector). Lets assume that first 25 are non-defective and next 25 are defective. Now, you need to create a group
matrix which tells SVM which are defective and which are not. So,
group = [ones(25,1); -1*ones(25,1)]; // non-defective = 1, defective = -1
SVMStruct = svmtrain(training, group);
SVMStruct
is the support vector which you will use for classifying 'Testing' data. Lets say testing
matrix contains Gabor features as previous.
results = svmclassify(SVMStruct, testing);
results
is the final decision matrix which contains 1 or -1 depending upon the decision made.