Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::color::ColorPercentile Class Reference

#include <ColorPercentile.h>

Inheritance diagram for prapi::color::ColorPercentile:

prapi::FeatureExtractor< int, Matrix< int > > Object List of all members.

Detailed Description

A feature extractor for calculating color percentiles.

The name may be somewhat misleading because percentiles are actually calculated from single-channel integer matrices. Typically, however, the input matrices are color channels extracted from multi-channel color images, hence the name.

Color percentiles are calculated from the probability integral of an image histogram. Percentiles can be calculated for values in the range [0,1], and the value for percentile x is the index of the histogram bin at which the probability integral exceeds (or equals) x.


Public Methods

 ColorPercentile ()
 Create a color percentile extractor with the percentiles intialized to {0.1, 0.2, ..., 0.9, 1.0}.

 ColorPercentile (const List< double > &percentiles)
 Create a color percentile extractor with the given percentiles.

List< int > getFeatureVector (const Matrix< int > &mat) throw (FeatureExtractionException&)
 Calculate the currently active color percentiles for an matrix.

void setPercentiles (const List< double > &percentiles)
 Set the percentiles to extract.

List< double > getPercentiles () const
 Get the currently active percentiles.

List< double > & percentiles ()
 Get the currently active percentiles.

const List< double > & percentiles () const
 Get the currently active percentiles.


Static Public Methods

int getPercentile (double percentile, List< int > histogram, int total=-1)
 Calculate a single color percentile.


Constructor & Destructor Documentation

prapi::color::ColorPercentile::ColorPercentile const List< double > &    percentiles [inline]
 

Create a color percentile extractor with the given percentiles.

Parameters:
percentiles  the color percentiles to calculate


Member Function Documentation

List< int > prapi::color::ColorPercentile::getFeatureVector const Matrix< int > &    mat throw (FeatureExtractionException&) [virtual]
 

Calculate the currently active color percentiles for an matrix.

The length of the returned vector is equal to the number of percentiles given in the constructor or set by the setPercentiles method.

Implements prapi::FeatureExtractor< int, Matrix< int > >.

int prapi::color::ColorPercentile::getPercentile double    percentile,
List< int >    histogram,
int    total = -1
[inline, static]
 

Calculate a single color percentile.

Parameters:
percentile  the percentile to calculate, in the range [0,1]
histogram  a histogram
total  the total number of entries in the histogram, for optimization.


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.