Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::filter::ColorDistanceOp Class Reference

Class for creating a color distance map. More...

#include <ColorDistanceOp.h>

Inheritance diagram for icl::filter::ColorDistanceOp:
icl::filter::UnaryOp icl::utils::Configurable

List of all members.

Public Member Functions

 ColorDistanceOp ()
 Dummy constructor (creates an uninitialized instance)
template<class Container >
 ColorDistanceOp (const Container &vec, double threshold=-1)
 create a new instance with given reference color and optional threshold
template<class ForewardIterator >
 ColorDistanceOp (ForewardIterator begin, ForewardIterator end, double threshold=-1)
 create with given iterator range for the reference color initialization
void apply (const core::ImgBase *src, core::ImgBase **dst)
 creates a color distance map
void setThreshold (double threshold)
 sets the threshold value
void setReferenceColor (const std::vector< double > &refColor)
 sets the current reference color
template<class Container >
void init (const Container &refColor, double threshold=-1)
 sets both reference color and threshold at once

Private Attributes

std::vector< double > m_refColor
 internal reference color
double m_threshold
 internal threshold

Detailed Description

Class for creating a color distance map.


Constructor & Destructor Documentation

Dummy constructor (creates an uninitialized instance)

template<class Container >
icl::filter::ColorDistanceOp::ColorDistanceOp ( const Container &  vec,
double  threshold = -1 
) [inline]

create a new instance with given reference color and optional threshold

If the given threshold is not -1, the resulting distance values are thresholded (so that pixels, that are closer than threshold to the referenceColor are set to 255. The reference color needs at least 3 entries.

template<class ForewardIterator >
icl::filter::ColorDistanceOp::ColorDistanceOp ( ForewardIterator  begin,
ForewardIterator  end,
double  threshold = -1 
) [inline]

create with given iterator range for the reference color initialization


Member Function Documentation

void icl::filter::ColorDistanceOp::apply ( const core::ImgBase src,
core::ImgBase **  dst 
) [virtual]

creates a color distance map

If the current threshold is not -1, then the result image becomes a binary 8-image. Otherwise, the resulting image is adapted to an Img32f. Only if the source depth is depth64f, and Img64f is also used for the result.

The source image is assumed to have 3 channels

Implements icl::filter::UnaryOp.

template<class Container >
void icl::filter::ColorDistanceOp::init ( const Container &  refColor,
double  threshold = -1 
) [inline]

sets both reference color and threshold at once

void icl::filter::ColorDistanceOp::setReferenceColor ( const std::vector< double > &  refColor) [inline]

sets the current reference color

void icl::filter::ColorDistanceOp::setThreshold ( double  threshold) [inline]

sets the threshold value


Member Data Documentation

std::vector<double> icl::filter::ColorDistanceOp::m_refColor [private]

internal reference color

internal threshold


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines