latest version v1.9 - last update 10 Apr 2010 |
Pareto evaluation of segmentation functors. More...
#include <ltiSegmentationEvaluation.h>
Classes | |
class | parameters |
The parameters for the class segmentationEvaluation. More... | |
Public Member Functions | |
segmentationEvaluation () | |
segmentationEvaluation (const parameters &par) | |
segmentationEvaluation (const segmentationEvaluation &other) | |
virtual | ~segmentationEvaluation () |
virtual const char * | getTypeName () const |
const parameters & | getParameters () const |
bool | setParameters (const functor::parameters &other) |
Public methods to be reimplemented | |
virtual bool | chromosomeToPhenotype (const chromosome &genotype, functor::parameters &phenotype) const =0 |
virtual functor::parameters * | chromosomeToPhenotype (const chromosome &genotype) const |
virtual bool | evaluateChromosome (const chromosome &individual, dvector &fitness) |
Protected Member Functions | |
bool | readData () |
std::string | getMaskName (const std::string &imgName, const std::string &postfix) const |
std::string | getPrevName (const std::string &imgName, const std::string &postfix) const |
virtual functor::parameters * | getInstanceOfParam () const =0 |
The segmentation evaluation methods | |
virtual bool | init (const functor::parameters ¶m)=0 |
virtual bool | segment (const image &img, const imatrix &prevStage, imatrix &mask, channel &certainty)=0 |
Protected Attributes | |
std::vector< image > | imageData |
std::vector< channel8 > | maskData |
std::vector< imatrix > | prevMaskData |
std::vector< std::string > | goldenNames |
Static Protected Attributes | |
static const int | totalFitnessDimensionality |
static const imatrix | emptyMatrix |
Evaluation Functions | |
The real evaluation is provided here in order to compute measures independently of the Pareto Front. | |
enum | { IdxNumRegions, IdxNumRegionsRecip, IdxPixelAccuracy, IdxObjectAccuracy, IdxRegionWiseInfo, IdxThroughput, IdxRegionIntegrity, IdxPixelCertainty } |
bool | evaluate (const functor::parameters ¶m, dvector &fitness) |
virtual bool | evaluate (const image &img, const channel8 &mask, const functor::parameters ¶m, dvector &fitness, dvector &norm) |
virtual bool | evaluate (const image &img, const imatrix &prevStage, const channel8 &mask, const functor::parameters ¶m, dvector &fitness, dvector &norm) |
virtual bool | evaluate (const image &img, const imatrix &prevStage, const channel8 &mask, dvector &fitness, dvector &norm) |
virtual bool | evaluate (const imatrix &result, const channel8 &refMask, dvector &fitness, dvector &norm, const float minValidRegionSize=0.0005) |
Pareto evaluation of segmentation functors.
This abstract class provides a basic framework for the evaluation of segmentation algorithms. The functor evaluates a result comparing it with some ground truth data, but it does not know anything about the parameterization of any algorithm, which should be done by derived classes.
Several measures are provided to evaluate the algorithms:
For the evaluation of a parameterization the algorithm takes all images stored in the file specified in parameters::images.
Following five methods have to be reimplemented in derived classes:
For the pareto front interface
For the real segmentation task
In the parameters you should define two sets of values for minimum and maximum tolerable values (usually called minValues and maxValues). The chromosomeToPhenotype method has to take care that the values produced lie in the corresponding intervals.
The definition of the used fitness measures can be found in the paper:
Mark Everingham, Henk Muller and Barry Thomas, "Evaluating Image Segmentation Algoritnms using the Pareto Front". Proceedings of the 7th European Conference on Computer Vision, 2002.
except the region integrity and pixel-wise certainty, which are described in
Pablo Alvarado, "Segmentation of color images for interactive 3D object retrieval", Dissertation, Aachen, 2004.
anonymous enum |
Index names for the complete multidimensional fitness measure.
lti::segmentationEvaluation::segmentationEvaluation | ( | ) |
Default constructor.
lti::segmentationEvaluation::segmentationEvaluation | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::segmentationEvaluation::segmentationEvaluation | ( | const segmentationEvaluation & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::segmentationEvaluation::~segmentationEvaluation | ( | ) | [virtual] |
Destructor.
virtual functor::parameters* lti::segmentationEvaluation::chromosomeToPhenotype | ( | const chromosome & | genotype | ) | const [virtual] |
Return a fresh allocated parameters for the evaluated functor, which is equivalent to the given genotype.
Implements lti::paretoFront.
virtual bool lti::segmentationEvaluation::chromosomeToPhenotype | ( | const chromosome & | genotype, | |
functor::parameters & | phenotype | |||
) | const [pure virtual] |
Convert a binary-chain representation of a chromosome to a valid parameter object.
Implements lti::paretoFront.
virtual bool lti::segmentationEvaluation::evaluate | ( | const imatrix & | result, | |
const channel8 & | refMask, | |||
dvector & | fitness, | |||
dvector & | norm, | |||
const float | minValidRegionSize = 0.0005 | |||
) | [virtual] |
Evaluation of segmentation.
Since you give already the results in this method, it is not possible to compute the throughput and certainty measures.
virtual bool lti::segmentationEvaluation::evaluate | ( | const image & | img, | |
const imatrix & | prevStage, | |||
const channel8 & | mask, | |||
dvector & | fitness, | |||
dvector & | norm | |||
) | [virtual] |
Evaluation of the segmentation with the given channel using a previously set parameterization.
The real measures for the single image are obtained with the element-wise division between fitness and norm. But if several images are used in the computations, the norms of each image have to be added first.
virtual bool lti::segmentationEvaluation::evaluate | ( | const image & | img, | |
const imatrix & | prevStage, | |||
const channel8 & | mask, | |||
const functor::parameters & | param, | |||
dvector & | fitness, | |||
dvector & | norm | |||
) | [virtual] |
Evaluation of the segmentation with the given channel using the given parameterization.
The real measures for the single image are obtained with the element-wise division between fitness and norm. But if several images are used in the computations, the norms of each image have to be added first.
virtual bool lti::segmentationEvaluation::evaluate | ( | const image & | img, | |
const channel8 & | mask, | |||
const functor::parameters & | param, | |||
dvector & | fitness, | |||
dvector & | norm | |||
) | [virtual] |
Evaluation of the segmentation with the given channel using the given parameterization.
The real measures for the single image are obtained with the element-wise division between fitness and norm. But if several images are used in the computations, the norms of each image have to be added first.
It is assumed that there is no previous stage (empty previous stage mask).
bool lti::segmentationEvaluation::evaluate | ( | const functor::parameters & | param, | |
dvector & | fitness | |||
) |
Evaluate the set of images (in the parameters) using the given parameterization.
param | parameters for the segmentation functor to be used in the evaluation. | |
fitness | multidimensional fitness measures for all images |
virtual bool lti::segmentationEvaluation::evaluateChromosome | ( | const chromosome & | individual, | |
dvector & | fitness | |||
) | [virtual] |
Evaluate Chromosome.
This method is one of the most important ones for the pareto evaluation. Its task is to produce a multidimensional fitness measure for a given chromosome.
It returns true if the evaluation was successful, of false if the phenotype represents some invalid parameterization. It is highly recomended that the mutation and crossover methods are reimplemented to avoid invalid parameterizations.
Implements lti::paretoFront.
virtual functor::parameters* lti::segmentationEvaluation::getInstanceOfParam | ( | ) | const [protected, pure virtual] |
Return a new object with the correct parameters' type.
std::string lti::segmentationEvaluation::getMaskName | ( | const std::string & | imgName, | |
const std::string & | postfix | |||
) | const [protected] |
Get the image name.
const parameters& lti::segmentationEvaluation::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::paretoFront.
std::string lti::segmentationEvaluation::getPrevName | ( | const std::string & | imgName, | |
const std::string & | postfix | |||
) | const [protected] |
Get the image name of the previous stage file.
virtual const char* lti::segmentationEvaluation::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("segmentationEvaluation").
Reimplemented from lti::paretoFront.
virtual bool lti::segmentationEvaluation::init | ( | const functor::parameters & | param | ) | [protected, pure virtual] |
Initialize the segmentation functor.
bool lti::segmentationEvaluation::readData | ( | ) | [protected] |
Read images and masks.
virtual bool lti::segmentationEvaluation::segment | ( | const image & | img, | |
const imatrix & | prevStage, | |||
imatrix & | mask, | |||
channel & | certainty | |||
) | [protected, pure virtual] |
Segmentate an image using the parameterization set with init().
img | image to be segmented | |
prevStage | segmentation mask from a previous stage. Image-based segmentation algorithms ignore this argument (in a strict sense they consider a mask in which each pixel has its own label). | |
mask | new segmentation labeled mask. | |
certainty | the certainty, with which the algorithm assigns each pixel to its label. If an algorithm does not provide such measure (like almost all image-based algorithms) this value will be empty, and for the computations it will be assumed that all pixels have a certainty of 1.0 to be what they are. |
bool lti::segmentationEvaluation::setParameters | ( | const functor::parameters & | other | ) | [virtual] |
Set the parameters.
Reimplemented from lti::functor.
const imatrix lti::segmentationEvaluation::emptyMatrix [static, protected] |
Empty matrix used everywhere.
std::vector<std::string> lti::segmentationEvaluation::goldenNames [protected] |
File names of the reference data.
std::vector<image> lti::segmentationEvaluation::imageData [protected] |
Cache for the images.
std::vector<channel8> lti::segmentationEvaluation::maskData [protected] |
Cache for the presegmentation masks.
std::vector<imatrix> lti::segmentationEvaluation::prevMaskData [protected] |
Cache for the previous stage masks.
const int lti::segmentationEvaluation::totalFitnessDimensionality [static, protected] |
Total number of fitness measures that will be computed.