latest version v1.9 - last update 10 Apr 2010 |
This functor splits an image into three channels of a color space set in the parameters (see parameters::setSplitter() ). More...
#include <ltiChannelStatistics.h>
Classes | |
class | parameters |
the parameters for the class channelStatistics More... | |
Public Member Functions | |
channelStatistics () | |
channelStatistics (const channelStatistics &other) | |
virtual | ~channelStatistics () |
virtual const char * | getTypeName () const |
bool | apply (const image &src, const areaPoints &obj, dvector &dest) const |
bool | apply (const image &src, dvector &dest) const |
channelStatistics & | copy (const channelStatistics &other) |
channelStatistics & | operator= (const channelStatistics &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
bool | getMin (const channel &ch, const areaPoints &obj, double &dest) const |
bool | getMax (const channel &ch, const areaPoints &obj, double &dest) const |
bool | getAverage (const channel &ch, const areaPoints &obj, double &dest) const |
bool | getGaussian (const channel &ch, const areaPoints &obj, double &m, double &v) const |
bool | getMedian (const channel &ch, const areaPoints &obj, double &dest) const |
bool | getMin (const channel &ch, const channel8 &mask, double &dest) const |
bool | getMax (const channel &ch, const channel8 &mask, double &dest) const |
bool | getAverage (const channel &ch, const channel8 &mask, double &dest) const |
bool | getGaussian (const channel &ch, const channel8 &mask, double &m, double &v) const |
bool | getMedian (const channel &ch, const channel8 &mask, double &dest) const |
This functor splits an image into three channels of a color space set in the parameters (see parameters::setSplitter() ).
From these channels it then calculates the Minimum, Maximum, Average, Median or Average and Variance over their values, depending on the parameter type.
It is possible to define a "transparent color" which will be ignored by the calculation.
lti::channelStatistics::channelStatistics | ( | ) |
default constructor
lti::channelStatistics::channelStatistics | ( | const channelStatistics & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::channelStatistics::~channelStatistics | ( | ) | [virtual] |
destructor
Calculates statics for each channel of the given image.
The kind of channels used depends on the parameter splitter which is a pointer of splitImage. Points which have the color param.ignoreColor are ignored.
src | image for feature extraction. | |
dest | the feature vector |
Reimplemented from lti::globalFeatureExtractor.
bool lti::channelStatistics::apply | ( | const image & | src, | |
const areaPoints & | obj, | |||
dvector & | dest | |||
) | const |
Calculates statics for each channel of the part of the given image indicated by the areaPoints.
The kind of channels used depends on the parameter splitter which is a pointer of splitImage. The different statistics are chosen through the parameter type:
Minimum | Minimum of each channel | 3 dimensions | |||
Maximum | Maximum of each channel | 3 dimensions | |||
Average | Average value of each channel | 3 dimensions | |||
Gaussian | First the mean values of each channel | 6 dimensions | then the variances | ||
Median | Median value of each channel | 3 dimensions |
src | image for feature extraction. | |
obj | area of the image that contains the object | |
dest | the feature vector |
virtual functor* lti::channelStatistics::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::globalFeatureExtractor.
channelStatistics& lti::channelStatistics::copy | ( | const channelStatistics & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::globalFeatureExtractor.
bool lti::channelStatistics::getAverage | ( | const channel & | ch, | |
const channel8 & | mask, | |||
double & | dest | |||
) | const [protected] |
Calculates the average value of the points of the given channel for which the mask entry is true.
ch | channel to be evaluated | |
mask | flag mask which tells for each point if it should be included in the statistics. | |
dest | the minimum value |
bool lti::channelStatistics::getAverage | ( | const channel & | ch, | |
const areaPoints & | obj, | |||
double & | dest | |||
) | const [protected] |
Calculates the average value of the points in obj of the given channel .
ch | channel to be evaluated | |
obj | list of points belonging to the object | |
dest | the average value |
bool lti::channelStatistics::getGaussian | ( | const channel & | ch, | |
const channel8 & | mask, | |||
double & | m, | |||
double & | v | |||
) | const [protected] |
Calculates a gaussian distribution of the points of the given channel for which the mask entry is true.
ch | channel to be evaluated | |
mask | flag mask which tells for each point if it should be included in the statistics. | |
m | the mean of the computed distribution | |
v | the variance of the computed distribution |
bool lti::channelStatistics::getGaussian | ( | const channel & | ch, | |
const areaPoints & | obj, | |||
double & | m, | |||
double & | v | |||
) | const [protected] |
Calculates the Gaussian, ie the mean and variance, of the points in obj of the given channel .
ch | channel to be evaluated | |
obj | list of points belonging to the object | |
m | the mean value | |
v | the variance |
bool lti::channelStatistics::getMax | ( | const channel & | ch, | |
const channel8 & | mask, | |||
double & | dest | |||
) | const [protected] |
Calculates the maximum value of the points of the given channel for which the mask entry is true.
ch | channel to be evaluated | |
mask | flag mask which tells for each point if it should be included in the statistics. | |
dest | the minimum value |
bool lti::channelStatistics::getMax | ( | const channel & | ch, | |
const areaPoints & | obj, | |||
double & | dest | |||
) | const [protected] |
Calculates the maximum value of the points in obj of the given channel .
ch | channel to be evaluated | |
obj | list of points belonging to the object | |
dest | the maximum value |
bool lti::channelStatistics::getMedian | ( | const channel & | ch, | |
const channel8 & | mask, | |||
double & | dest | |||
) | const [protected] |
Calculates the median of the points of the given channel for which the mask entry is true.
ch | channel to be evaluated | |
mask | flag mask which tells for each point if it should be included in the statistics. | |
dest | the minimum value |
bool lti::channelStatistics::getMedian | ( | const channel & | ch, | |
const areaPoints & | obj, | |||
double & | dest | |||
) | const [protected] |
Calculates the median of all values of the points in obj of the given channel .
ch | channel to be evaluated | |
obj | list of points belonging to the object | |
dest | the median of all values |
bool lti::channelStatistics::getMin | ( | const channel & | ch, | |
const channel8 & | mask, | |||
double & | dest | |||
) | const [protected] |
Calculates the minimum value of the points of the given channel for which the mask entry is true.
ch | channel to be evaluated | |
mask | flag mask which tells for each point if it should be included in the statistics. | |
dest | the minimum value |
bool lti::channelStatistics::getMin | ( | const channel & | ch, | |
const areaPoints & | obj, | |||
double & | dest | |||
) | const [protected] |
Calculates the minimum value of the points in obj of the given channel .
ch | channel to be evaluated | |
obj | list of points belonging to the object | |
dest | the minimum value |
const parameters& lti::channelStatistics::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::globalFeatureExtractor.
virtual const char* lti::channelStatistics::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("channelStatistics")
Reimplemented from lti::globalFeatureExtractor.
channelStatistics& lti::channelStatistics::operator= | ( | const channelStatistics & | other | ) |