Image Component Library (ICL)
|
Accumulate weighted pixel values of all image channels. More...
#include <WeightedSumOp.h>
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< icl64f > | m_vecWeights |
internal storage for the channel weights |
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:
where is the destination image, is the source image, is the weights vector and 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)
icl::filter::WeightedSumOp::WeightedSumOp | ( | ) | [inline] |
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
weights | channel weights vector |
void icl::filter::WeightedSumOp::apply | ( | const core::ImgBase * | poSrc, |
core::ImgBase ** | ppoDst | ||
) | [virtual] |
applies this operation on the source image
poSrc | source image |
ppoDst | destination 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
void icl::filter::WeightedSumOp::setWeights | ( | const std::vector< icl64f > & | weights | ) | [inline] |
sets up the current weights vector
weights | new weight vector |
std::vector<icl64f> icl::filter::WeightedSumOp::m_vecWeights [private] |
internal storage for the channel weights