Image Component Library (ICL)
|
Weight pixel values of all image channels. More...
#include <WeightChannelsOp.h>
Public Member Functions | |
WeightChannelsOp () | |
creates a new WeightChannelsOp object | |
WeightChannelsOp (const std::vector< icl64f > &weights) | |
creates an new WeightChannelsOp 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 |
Weight pixel values of all image channels.
Pixels of all channels in source image are weighted by a channel-wise weight:
where is the destination image, is the source image, is the weight vector and is the source images channel count.
Performance: 1000x1000 image with 10 channels averaged over 100 runs (1,83 GHz Core Duo)
Performance: 1000x1000 image with 3 channels averaged over 100 runs (1,83 GHz Core Duo)
icl::filter::WeightChannelsOp::WeightChannelsOp | ( | ) | [inline] |
creates a new WeightChannelsOp object
icl::filter::WeightChannelsOp::WeightChannelsOp | ( | const std::vector< icl64f > & | weights | ) | [inline] |
creates an new WeightChannelsOp object with a given weights vector
weights | channel weights vector |
void icl::filter::WeightChannelsOp::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::WeightChannelsOp::getWeights | ( | ) | const [inline] |
returns the current weight vector
void icl::filter::WeightChannelsOp::setWeights | ( | const std::vector< icl64f > & | weights | ) | [inline] |
sets up the current weights vector
weights | new weight vector |
std::vector<icl64f> icl::filter::WeightChannelsOp::m_vecWeights [private] |
internal storage for the channel weights