The texture classification algorithm under test is the only component of the framework which is modifiable by the user; all other operational aspects of framework are fixed to ensure the integrity of the MeasTex framework.
The interface to texture classification algorithms is specified enabling seamless testing of additional algorithms. A texture problem is presented to an algorithm via a fixed format Test file specified on the command line. This file must be opened and parsed to obtain the problem definition. Facility is made for algorithm-specific command line options but the last argument will always be the name of the Test file.
The internal implementation of an algorithm will usually require a two stage operation. Firstly, the algorithm must process the estimation images and build a classifier based on these examples. Secondly, it must process the validation images in turn and produce a classification for each.
For each validation image, algorithms must output
a classification vector with one value for every known class.
Ideally, the value for each class will represent the certainty that
the validation image belongs to that class as ascertained by the
algorithm. These values need not be probabilities but will be
normalized as such in the metric.
Any algorithm may be tested within the framework providing it meets
the interface requirements. The basic functionality of an algorithm
is
Two files, src/template/template.c and
src/template/template.h, have been provided to ease the
burden of implementing a new algorithm. These files include code
which takes care of the interface requirements of the algorithm.
Specifically, code is provided to parse the test file, setup
structures containing the information relevant to each class, and
write out the results of the classification.
If your intended classifier can treat each class in isolation, then
the function BuildAllModels() will loop across each class
calling BuildModels() with estimation images for that class.
Your algorithm can be implemented at the BuildModels()
functional level. If the algorithm requires all classes to be
considered at once, the classifier should be implemented directly at
BuildAllModels(). This will probably require some
modification to the Class and Model structures as it is likely that
only a single model is necessary.
When models are built for each class, the validation phase begins.
Each of the unknown validation images is presented to the classifier
and a number proportional to the "relative certainty" that the image
is consistent with each class is determined and returned in a
classification vector. Two classifiers have been implemented :
Multivariate Gaussian Bayes classifier and K-Nearest Neighbours
classifier. The classifier function is called for each class to
construct the classification vector for a test image. This vector is
then written to standard output.
For more information, see examples of algorithm source
code in the src directory.
Adding a new algorithm