latest version v1.9 - last update 10 Apr 2010 |
Pareto evaluation of the lti::pyramidLocationSearch functor. More...
#include <ltiLocationSearchEvaluation.h>
Classes | |
class | parameters |
The parameters for the class locationSearchEvaluation. More... | |
Public Member Functions | |
locationSearchEvaluation () | |
locationSearchEvaluation (const parameters &par) | |
locationSearchEvaluation (const locationSearchEvaluation &other) | |
virtual | ~locationSearchEvaluation () |
virtual const char * | getTypeName () const |
virtual functor * | clone () const |
const parameters & | getParameters () const |
bool | setParameters (const functor::parameters &par) |
Public methods to be reimplemented | |
virtual bool | chromosomeToPhenotype (const chromosome &genotype, functor::parameters &phenotype) const |
virtual functor::parameters * | chromosomeToPhenotype (const chromosome &genotype) const |
virtual bool | phenotypeToChromosome (const functor::parameters &phenotype, chromosome &genotype) const |
virtual int | getChromosomeSize () const |
virtual bool | evaluateChromosome (const chromosome &individual, dvector &fitness) |
Protected Member Functions | |
bool | evaluate (const channel &chnl, const channel8 &mask, dvector &fitness) |
bool | compare (const kdTree< tpoint< float >, int > &olocs, const std::vector< location > &olocs, const std::vector< location > &blocs, int &posStable, int &rotStable) const |
Static Protected Attributes | |
static const int | totalFitnessDimensionality |
Evaluation Functions | |
The real evaluation is provided here in order to compute measures independently of the Pareto Front. | |
enum | { IdxTime, IdxNumberOfLocations, IdxLocationsRecip, IdxOccupiedLevels, IdxScalePosRep, IdxRotationPosRep, IdxRSPosRep, IdxScaleARep, IdxRotationARep, IdxRSARep, IdxScalePosStable, IdxRotationPosStable, IdxRSPosStable, IdxScaleAStable, IdxRotationAStable, IdxRSAStable } |
bool | evaluate (const pyramidLocationSearch::parameters ¶m, dmatrix &fitness, const bool onlyMeanAndVariance=false) |
bool | evaluate (const channel &chnl, const pyramidLocationSearch::parameters ¶m, dvector &fitness) |
Pareto evaluation of the lti::pyramidLocationSearch functor.
This class tests the parameterization of the lti::pyramidLocationSearch functor by searching the Pareto front of some fittness measures, using the genetic search framework provided by the paretoFront class.
The fitness criteria used here are:
For the evaluation of a parameterization the algorithm takes all images stored in the file specified in parameters::images. For each one of them a set of rotations and scalings are applied, to the image and the locations estracted from it. Since the geometric transformation is known, we have a "should-be" set of locations, obtained transforming the original image locations. This set is compared with the locations extracted from the transformed image. The correspondences are counted and they constitute in percentage the fitness measure.
The "repeatability" measures equal the "stable locations" normalized by the total number of locations.
anonymous enum |
Index names for the complete multidimensional fitness measure.
IdxTime |
Well, this is not really time, because that would be "cost" instead of "fitness", in reality, * this dimension contains 1.0/time in s^-1, meaning the number of complete location extractions per second. |
IdxNumberOfLocations |
Mean number of extracted locations. |
IdxLocationsRecip |
Location reciprocal. Inverse of the number of locations detected. |
IdxOccupiedLevels |
Mean number of occupied levels. |
IdxScalePosRep |
Scale repeatability defined as total number of stable locations divided by the total number of locations for changes of scaling only. |
IdxRotationPosRep |
Rotation repeatability defined as total number of stable locations divided by the total number of locations for changes in the rotation only. |
IdxRSPosRep |
Rotation repeatability defined as total number of stable locations divided by the total number of locations for changes in the rotation and scale. This will only be computed if the RSRepeatability bit in the parameters is enabled (it costs too much time!). |
IdxScaleARep |
Scale angular repeatability defined as total number of angular stable locations divided by the total number of locations for changes of scaling only. |
IdxRotationARep |
Rotation angular repeatability defined as total number of angular stable locations divided by the total number of locations for changes in the rotation only. |
IdxRSARep |
Angular repeatability defined as total number of angular stable locations divided by the total number of locations for changes in the rotation and scale. This will only be computed if the RSRepeatability bit in the parameters is enabled (it costs too much time!). |
IdxScalePosStable |
Scale stability defined as total number of stable locations divided by the total number of locations for changes of scaling only. |
IdxRotationPosStable |
Rotation stability defined as total number of stable locations divided by the total number of locations for changes in the rotation only. |
IdxRSPosStable |
Rotation stability defined as total number of stable locations divided by the total number of locations for changes in the rotation and scale. This will only be computed if the RSStability bit in the parameters is enabled (it costs too much time!). |
IdxScaleAStable |
Scale angular stability defined as total number of angular stable locations divided by the total number of locations for changes of scaling only. |
IdxRotationAStable |
Rotation angular stability defined as total number of angular stable locations divided by the total number of locations for changes in the rotation only. |
IdxRSAStable |
Angular stability defined as total number of angular stable locations divided by the total number of locations for changes in the rotation and scale. This will only be computed if the RSStability bit in the parameters is enabled (it costs too much time!). |
lti::locationSearchEvaluation::locationSearchEvaluation | ( | ) |
Default constructor.
lti::locationSearchEvaluation::locationSearchEvaluation | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::locationSearchEvaluation::locationSearchEvaluation | ( | const locationSearchEvaluation & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::locationSearchEvaluation::~locationSearchEvaluation | ( | ) | [virtual] |
Destructor.
virtual functor::parameters* lti::locationSearchEvaluation::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::locationSearchEvaluation::chromosomeToPhenotype | ( | const chromosome & | genotype, | |
functor::parameters & | phenotype | |||
) | const [virtual] |
Convert a binary-chain representation of a chromosome to a valid parameter object.
Implements lti::paretoFront.
virtual functor* lti::locationSearchEvaluation::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::paretoFront.
bool lti::locationSearchEvaluation::compare | ( | const kdTree< tpoint< float >, int > & | olocs, | |
const std::vector< location > & | olocs, | |||
const std::vector< location > & | blocs, | |||
int & | posStable, | |||
int & | rotStable | |||
) | const [protected] |
Compare both location sets.
olocs | original image location set. | |
blocs | back-transformed location set from the location extracted from the transformed image. | |
posStable | number of locations stable respect their position | |
rotStable | number of locations also stable in detected rotation angle (rotStable <= posStable). |
bool lti::locationSearchEvaluation::evaluate | ( | const channel & | chnl, | |
const pyramidLocationSearch::parameters & | param, | |||
dvector & | fitness | |||
) |
bool lti::locationSearchEvaluation::evaluate | ( | const pyramidLocationSearch::parameters & | param, | |
dmatrix & | fitness, | |||
const bool | onlyMeanAndVariance = false | |||
) |
Evaluate the set of images (in the parameters) using the given parameterization.
param | parameters of the location selector to be used in the evaluation. | |
fitness | multidimensional fitness measures for each image in one row. | |
onlyMeanAndVariance | if true, the mean and variance of all results will be computed. Otherwise all fitness measures for all images will be provided. |
virtual bool lti::locationSearchEvaluation::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 int lti::locationSearchEvaluation::getChromosomeSize | ( | ) | const [virtual] |
Return the length in bits for a chromosome.
This method needs to be reimplemented, in order to get some default implementations to work.
Implements lti::paretoFront.
const parameters& lti::locationSearchEvaluation::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::paretoFront.
virtual const char* lti::locationSearchEvaluation::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("locationSearchEvaluation").
Reimplemented from lti::paretoFront.
virtual bool lti::locationSearchEvaluation::phenotypeToChromosome | ( | const functor::parameters & | phenotype, | |
chromosome & | genotype | |||
) | const [virtual] |
Convert a valid parameters object (phenotype) into binary-chain representation of a chromosome.
Implements lti::paretoFront.
bool lti::locationSearchEvaluation::setParameters | ( | const functor::parameters & | par | ) | [virtual] |
Set parameters.
Reimplemented from lti::functor.
const int lti::locationSearchEvaluation::totalFitnessDimensionality [static, protected] |
Total number of fitness measures that will be computed.