LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::downsampling Class Reference
[Linear filtering]

This functor is used to downsample images. More...

#include <ltiDownsampling.h>

Inheritance diagram for lti::downsampling:
Inheritance graph
[legend]
Collaboration diagram for lti::downsampling:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class downsampling More...

Public Member Functions

 downsampling ()
 downsampling (const parameters &par)
 downsampling (const mathObject &aKernel)
 downsampling (const downsampling &other)
virtual ~downsampling ()
virtual const char * getTypeName () const
bool apply (channel8 &srcdest) const
bool apply (matrix< float > &srcdest) const
bool apply (dmatrix &srcdest) const
bool apply (image &srcdest) const
bool apply (vector< channel8::value_type > &srcdest) const
bool apply (vector< channel::value_type > &srcdest) const
bool apply (const channel8 &src, channel8 &dest) const
bool apply (const matrix< float > &src, matrix< float > &dest) const
bool apply (const dmatrix &src, dmatrix &dest) const
bool apply (const image &src, image &dest) const
bool apply (const vector< channel8::value_type > &src, vector< channel8::value_type > &dest) const
bool apply (const vector< channel::value_type > &src, vector< channel::value_type > &dest) const
downsamplingcopy (const downsampling &other)
virtual functorclone () const
const parametersgetParameters () const
void setKernel (const mathObject &aKernel)

Detailed Description

This functor is used to downsample images.

Here, the process of downsampling means to first filter the image with (usually) a low pass filter, and then take each n-th pixel, where n is an integer number.

The downsampling::parameters specify which kind of filter should be used and which downsampling factor. If you do not want or need to low-pass filter the image first, than take a look at lti::decimation.

If you need to "downsample" an image with a non-integer factor take a look to lti::scaling.

See also:
lti::decimation, lti::upsampling, lti::filledUpsampling,lti::scaling

Example:

 #include "ltiDownsampling.h"
 #include "ltiGaussKernel2D.h"
   
 lti::channel chnl1,chnl2;
   
 ...
   
 lti::downsampling downsampler;       // downsampling functor
 lti::downsampling::parameters param; // downsampling parameters
   
 // a gaussian kernel to use before the downsampling
 lti::gaussKernel2D<lti::channel::value_type> gkernel;
   
 param.setKernel(gkernel);  // use the gaussian kernel
   
 downsampler.setParameters(param);  // use the given parameters

 downsampler.apply(chnl1,chnl2);  // channel 1 will be downsampled an the
                                  // result will be left on channel 2.

Constructor & Destructor Documentation

lti::downsampling::downsampling (  ) 

default constructor

lti::downsampling::downsampling ( const parameters par  ) 

Constructor with parameters object.

lti::downsampling::downsampling ( const mathObject aKernel  ) 

create a downsampling functor with a parameter set which includes the given filter kernel

lti::downsampling::downsampling ( const downsampling other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::downsampling::~downsampling (  )  [virtual]

destructor


Member Function Documentation

bool lti::downsampling::apply ( const vector< channel::value_type > &  src,
vector< channel::value_type > &  dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src vector<channel::value_type> with the source data.
dest vector<channel::value_type> where the result will be left.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( const vector< channel8::value_type > &  src,
vector< channel8::value_type > &  dest 
) const

operates on a copy of the given parameters.

Parameters:
src vector<channel8::value_type> with the source data.
dest vector<channel8::value_type> where the result will be left.
Returns:
true if successful, false otherwise.
bool lti::downsampling::apply ( const image src,
image dest 
) const [virtual]

downsample a color image by splitting it into the RGB components, downsampling each channel and merging the results

Parameters:
src image with the source data.
dest image where the result will be left.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( const dmatrix src,
dmatrix dest 
) const

operates on a copy of the given parameters.

Parameters:
src dmatrix with the source data.
dest dmatrix where the result will be left.
Returns:
true if successful, false otherwise.
bool lti::downsampling::apply ( const matrix< float > &  src,
matrix< float > &  dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src channel with the source data.
dest channel where the result will be left.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( const channel8 src,
channel8 dest 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( vector< channel::value_type > &  srcdest  )  const

operates on the given parameter.

Parameters:
srcdest vector<channel::value_type> with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( vector< channel8::value_type > &  srcdest  )  const

operates on the given parameter.

Parameters:
srcdest vector<channel8::value_type> with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.
bool lti::downsampling::apply ( image srcdest  )  const [virtual]

downsample a color image by splitting it into the RGB components, downsampling each channel and merging the results

Parameters:
srcdest image with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( dmatrix srcdest  )  const

operates on the given parameter.

Parameters:
srcdest dmatrix with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.
bool lti::downsampling::apply ( matrix< float > &  srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest channel with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

bool lti::downsampling::apply ( channel8 srcdest  )  const [virtual]

operates on the given parameter.

Parameters:
srcdest channel8 with the source data. The result will be left here too.
Returns:
true if successful, false otherwise.

Reimplemented from lti::modifier.

virtual functor* lti::downsampling::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

downsampling& lti::downsampling::copy ( const downsampling other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

const parameters& lti::downsampling::getParameters (  )  const

returns used parameters

Reimplemented from lti::modifier.

virtual const char* lti::downsampling::getTypeName (  )  const [virtual]

returns the name of this type ("downsampling")

Reimplemented from lti::modifier.

void lti::downsampling::setKernel ( const mathObject aKernel  ) 

shortcut to set the filter kernel A copy of the given parameter will be made!

Parameters:
aKernel the filter kernel to be used

The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:13 2010 for LTI-Lib by Doxygen 1.6.1