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

Accumulate weighted pixel values of all image channels. More...

#include <WeightedSumOp.h>

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

List of all members.

Public Member Functions

 WeightedSumOp ()
 creates a new WeightedSumOp object
 WeightedSumOp (const std::vector< icl64f > &weights)
 creates an new WeightedSumOp object with a given weights vector
void apply (const core::ImgBase *poSrc, core::ImgBase **ppoDst)
 applies this operation on the source image
const std::vector< icl64f > & getWeights () const
 returns the current weight vector
void setWeights (const std::vector< icl64f > &weights)
 sets up the current weights vector

Private Attributes

std::vector< icl64fm_vecWeights
 internal storage for the channel weights

Detailed Description

Accumulate weighted pixel values of all image channels.

Pixels of all channels in source image are weighted by a channel-wise weight and accumulated to the destination image:

\[ D(x,y,0) = \sum\limits_{c=0}^C S(x,y,c)*w(c) \]

where $D$ is the destination image, $S$ is the source image, $w$ is the weights vector and $C$ is the source images channel count. The result image is created with depth32f by default. Only if the source image has a 64Bit floating point depth (depth64f), the destination image is adapted to depth64f to avoid loss of precession.

Performance: 1000x1000 image with 10 channels (1400Mhz Centrino)

Performance: 1000x1000 image with 3 channels (1400Mhz Centrino)


Constructor & Destructor Documentation

creates a new WeightedSumOp object

icl::filter::WeightedSumOp::WeightedSumOp ( const std::vector< icl64f > &  weights) [inline]

creates an new WeightedSumOp object with a given weights vector

Parameters:
weightschannel weights vector

Member Function Documentation

void icl::filter::WeightedSumOp::apply ( const core::ImgBase poSrc,
core::ImgBase **  ppoDst 
) [virtual]

applies this operation on the source image

Parameters:
poSrcsource image
ppoDstdestination image (adapted to icl32f by default, if the source image has depth64f, ppoDst is adapted to icl64f too.

Implements icl::filter::UnaryOp.

const std::vector<icl64f>& icl::filter::WeightedSumOp::getWeights ( ) const [inline]

returns the current weight vector

Returns:
reference to the current weight vector
void icl::filter::WeightedSumOp::setWeights ( const std::vector< icl64f > &  weights) [inline]

sets up the current weights vector

Parameters:
weightsnew weight vector

Member Data Documentation

internal storage for the channel weights


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