Basic Image AlgorithmS Library 2.8.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

BIAS::BackwardMapping< InputStorageType, OutputStorageType > Class Template Reference

Abstract base class to map an image (texture) src to an image sink with an arbitrary continuous function (e.g. More...

#include <Image/BackwardMapping.hh>

Inheritance diagram for BIAS::BackwardMapping< InputStorageType, OutputStorageType >:
Collaboration diagram for BIAS::BackwardMapping< InputStorageType, OutputStorageType >:

List of all members.

Public Member Functions

 BackwardMapping ()
 Constructor.
virtual int GetBoundingBox (unsigned int, unsigned int, unsigned int sinkwidth, unsigned int sinkheight, int &tlx, int &tly, int &brx, int &bry)
 calculates the bounding box in sink image, where to do the backward mapping.
int GetJacobian (const HomgPoint2D &sink, Matrix2x2< double > &Jacobian) const
 get jacobian (including concatenated mappings)
int GetSourceCoordinates (const HomgPoint2D &sink, HomgPoint2D &source) const
 wrapper function to allow the lookup implementation to be shared with other algorithms.
void SetConcatenation (BIAS::BackwardMapping< InputStorageType, OutputStorageType > *pCon)
 avoid intermediate image and concatenate two backward mappings
void SetPyramidSize (const int newsize)
 sets pyramid size to pyramid and updates if neccessary
virtual void UpdatePyramidSize (const Image< OutputStorageType > &sink)
 use coordinates from sink to estimate maximum pyramid level needed, update pyramid size
virtual ~BackwardMapping ()
 Destructor.
User interfaces
int Map (const Image< InputStorageType > &src, Image< OutputStorageType > &sink, InterpolationMethod=MapTrilinear, bool newSink=false, double SuperSampling=1.0)
 backward mapping with various interpolations
int Map (Image< OutputStorageType > &sink)
 use this for subsequent calls to avoid pyramid recalculation when using tri-filtering
int GetDisplacementMap (Image< float > &dismap, int width, int height)
 precomputes lookup coordinates and computes displacement map int TEXTURE coordinates, according to the size of src (or width,height)
int GetDisplacementMap (Image< float > &dismap, Image< InputStorageType > &src)
int PrepareLookupTableMapping (const Image< InputStorageType > &src, Image< OutputStorageType > &sink, InterpolationMethod method, bool newSink=false)
 precomputes lookup coordinates for accessing src
int MapWithLookupTable (const Image< InputStorageType > &src, Image< OutputStorageType > &sink, InterpolationMethod method)
 applies precomputed coordinates in src, fast for repeated usages of same mapping function
int GetLookupTable (const std::string &filename, InterpolationMethod method)
 Returns the LUT generated by PrepareLookupTableMapping() as an file.
int GetLookupTable (float *lutImageRow, InterpolationMethod method)
int GetLookupTableSize (unsigned int &width, unsigned int &channels, InterpolationMethod method)
 returns the size of the current LUT.
int SetLookupTable (const std::string &filename, InterpolationMethod &method)
 Loads the LUT from a file, replaces the call to PrepareLookupTableMapping().
int SetLookupTable (const float *lutImageRow, unsigned int width, InterpolationMethod &method)

Static Public Member Functions

static void GenerateTestImage (Image< InputStorageType > &testimage, bool highFrequencyCross=true, InputStorageType dark=5, InputStorageType bright=127, const Matrix3x3< double > &Hinv=Matrix3x3< double >(MatrixIdentity))
 generates a siemens star like test image with lots of different frequencies to test backward mapping

Protected Member Functions

virtual void BuildPyramid_ (const Image< InputStorageType > &source, bool forceInit=true)
 compute maximum number of pyramid levels needed
virtual int CalcCoordOffset_ (const Image< OutputStorageType > &sink, const Image< InputStorageType > &source)
 result in offsetX_,offsetY_
virtual int ChangeImgSize_ (Image< OutputStorageType > &, const Image< InputStorageType > &)
void ClipBoundingBoxToROICorners_ (const BIAS::Image< OutputStorageType > &sink, int &tlx, int &tly, int &brx, int &bry) const
 clip computed region in dest image to roi
template<>
void ClipValue_ (const double &value, unsigned char &newvalue)
template<>
void ClipValue_ (const double &value, float &newvalue)
void ClipValue_ (const double &value, OutputStorageType &newvalue)
 clip interpolated value to outputstoragetype and merge old and new value according to alpha
template<>
void ClipValue_ (const double &value, float &newvalue)
template<>
void ClipValue_ (const double &value, unsigned char &newvalue)
geometrical coordinate mapping functions
virtual int GetSourceCoordinates_ (const HomgPoint2D &sink, HomgPoint2D &source) const
 actual mapping function which takes a point from sink and computes a point in source and a local sampling frequency
virtual int GetJacobian_ (const HomgPoint2D &sink, Matrix2x2< double > &Jacobian) const
 numeric approximation of jacobian, reimplement in derived class to make an analytic jacobian
void ComputeLocalPyramidLayer_ (const HomgPoint2D &p_sink, double &localscale)
 computes pyramid layer for trilinear filtering, e.g.
pixel-value-mapping worker functions
int MapTri_ (Image< OutputStorageType > &sink)
 map image avoiding aliasing
int MapTrilinearGreySimple_ (Image< OutputStorageType > &sink)
 fast trilinear grey without special features
int MapBi_ (const Image< InputStorageType > &source, Image< OutputStorageType > &sink, InterpolationMethod interpolationQuality)
 bilinear, bicubc and nearest neighbor interpolation
int GetImageValue_ (const double &xsource, const double &ysource, const Image< InputStorageType > &im, unsigned int channel, double &result)
 worker function, which handles bilinear/bicubic interpolation, borders and weights
int GetTrilinearImageValue_ (const double &xsource, const double &ysource, const double &scale, unsigned int channel, double &result)
 worker function, which handles bilinear/bicubic interpolation, pyramid levels, borders and weights
int GetAnisotropicImageValue_ (const double &xsource, const double &ysource, Matrix2x2< double > &Jacobian, unsigned int channel, double &thereturnvalue)
 use jacobian of mapping function to do anisotropic antialiasing

Protected Attributes

bool aliasing_
 set to true if possibility of aliasing is detected during mapping
BIAS::Image< float > alphaImg_
 has same size as overlap region used for blending
bool autoPyramidSize_
 pyramid size set by user or computed automatically ?
double height_
 source image height
bool incomplete_
 set to true if not every pixel could be computed
InterpolationMethod interpolationType_
 which interpolation method are we using
int offsetX_
 needed for newDist
int offsetY_
BackwardMapping
< InputStorageType,
OutputStorageType > * 
pConcatenation_
BWM_LUT_Entry_AnisotropicpLUT_Ani_
 NOT IMPLEMENTED (YET ?)
BWM_LUT_Entry_BicubicpLUT_Bic_
BWM_LUT_Entry_BilinearpLUT_Bil_
int pLUT_Bil_size
BWM_LUT_Entry_NearestpLUT_Nea_
 lookup-tables for precomputed positions in source, same size as dst.PixelCount
int pLUT_Nea_size
BWM_LUT_Entry_TrilinearpLUT_Tri_
int pLUT_Tri_size
PyramidImage< InputStorageType > pyramid_
 this contains a pyramid of the last source image for anti-aliasing
unsigned pyramidSize_
bool rangeChecked_
 The interpolated value is computed in double; if clipped value is not specialized for your output storage type (e.g.
ROI ROI_
 the roi of the last source image
double superSampling_
 if larger than 1, super resolution is active
double width_
 source image width

Detailed Description

template<class InputStorageType, class OutputStorageType>
class BIAS::BackwardMapping< InputStorageType, OutputStorageType >

Abstract base class to map an image (texture) src to an image sink with an arbitrary continuous function (e.g.

rotation, homography, undistortion, rectification, ...). Provides interpolation, border checking and anti-aliasing.

If you want to learn more about texture handling, a good source is Paul Heckbert: "Fundamentals of Texture Mapping and Image Warping", Master's thesis, UCB/CSD 89/516, CS Division, U.C. Berkeley, June 1989 available at http://www.cs.cmu.edu/~ph/texfund/texfund.pdf

This class implements a backward mapping and runs over all(*) pixels of some output image. For each pixel it calls GetSourceCoordinates (which you have to implement in your derived class) to compute the coordinates in the source image. The local sampling frequency can be computed to avoid aliasing. Either you make an analytic implementation or simply use the good (but maybe slow) numerical approximation from BackwardMapping.

For instance if you scale an image by factor 2, you would implement GetSourceCoordinates as source_coord = 0.5 * sink_coord and the local sampling frequency would be 0.5. Sampling frequencies below 1 wont introduce aliasing, while those larger than 1 can. Therefore local low pass filtering is simulated by using a pyramid of the input image.

The local sampling frequency of your mapping function can be approximated analyzing the jacobian of the function as a R^2->R^2 mapping, see HomographyMapping for an example or simply use the numerical solution in this class if you are not interested in speed. However, using an image pyramid, isotropic scaling is assumed, if you resample by 0.3 in x-direction and 5.0 in y direction, both dirs are smoothed with the same sigma and you will lose image information. If you want to remove such effects, use anisotropic filtering. This is the (by far) slowest but best technique. If you use highly nonlinear mapping functions, the quality of your result can improve if you compute a larger image and reduce size by subsequent subsamping in destination space. This technique is called super-sampling.

To make a pyramid of correct size, Backwardmapping::UpdatePyramidSize maps the corners of your sink image and computes the local scale at these corners assuming maximum scale at one corner. If your derived mapping function has a maximum scale somewhere else (e.g. cylindircal rectification), you must override UpdatePyramidSize.

If possible,bicubic interpolation is done in the image, at borders (high pyramid levels) only bilinear. For efficiency (**) or comparison, you can disable the usage of pyramids, speeding up the computation (bicubic, bilinear, nearest neighbor).

(*) "all" means: getboundingbox forward-maps src-corners to sink with inverse mapping (has to be implmented in derived class !) and these corners are clipped against the ROI of sink.

(**)The first goal of this source code is that it is generic and correct. Therefore, in the most inner loop the number of color channels is evaluated and weighting factors are computed several times. If you want to be fast, add specialized functions for grey, and exploit the structure of your problem (see e.g. AffineMapping which has a constant Jacobian, ..). You might as well consider using the GPU if your mapping is "fixed" (radial undistortion with always the same parameters) or use the lookup table interfaces if you can afford precomputing your coefficients (e.g. for a constant mapping applied hundereds of times)

OPENMP - open multiprocessing support: In the most generic trilinear and anisotropic loop, openmp is enabled if it is enabled at all in BIAS (should be by default). So far it is not implmented for grey(!) and for bilinear/bicubic mappings (but this is only enumerating the right variables in 3 lines of code and some tests).

Author:
koeser, 2005
Examples:

ExampleHomographyMapping.cpp.

Definition at line 123 of file BackwardMapping.hh.


Constructor & Destructor Documentation

template<class InputStorageType, class OutputStorageType>
BIAS::BackwardMapping< InputStorageType, OutputStorageType >::BackwardMapping ( ) [inline]

Constructor.

Definition at line 130 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
virtual BIAS::BackwardMapping< InputStorageType, OutputStorageType >::~BackwardMapping ( ) [inline, virtual]

Destructor.

Definition at line 154 of file BackwardMapping.hh.


Member Function Documentation

template<class InputStorageType, class OutputStorageType >
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::BuildPyramid_ ( const Image< InputStorageType > &  source,
bool  forceInit = true 
) [protected, virtual]

compute maximum number of pyramid levels needed

Definition at line 207 of file BackwardMapping.cpp.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::CalcCoordOffset_ ( const Image< OutputStorageType > &  sink,
const Image< InputStorageType > &  source 
) [protected, virtual]

result in offsetX_,offsetY_

Definition at line 997 of file BackwardMapping.cpp.

References BIAS::ImageBase::GetHeight(), and BIAS::ImageBase::GetWidth().

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::ChangeImgSize_ ( Image< OutputStorageType > &  sink,
const Image< InputStorageType > &  source 
) [protected, virtual]
template<class InputStorageType , class OutputStorageType>
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::ClipBoundingBoxToROICorners_ ( const BIAS::Image< OutputStorageType > &  sink,
int &  tlx,
int &  tly,
int &  brx,
int &  bry 
) const [protected]

clip computed region in dest image to roi

Definition at line 981 of file BackwardMapping.cpp.

References BIAS::ImageBase::GetROICorners().

template<>
void BIAS::BackwardMapping< unsigned char, unsigned char >::ClipValue_ ( const double &  value,
unsigned char &  newvalue 
) [inline, protected]

Definition at line 606 of file BackwardMapping.hh.

template<>
void BIAS::BackwardMapping< float, float >::ClipValue_ ( const double &  value,
float &  newvalue 
) [inline, protected]

Definition at line 615 of file BackwardMapping.hh.

template<>
void BIAS::BackwardMapping< float, unsigned char >::ClipValue_ ( const double &  value,
unsigned char &  newvalue 
) [inline, protected]

Definition at line 622 of file BackwardMapping.hh.

template<>
void BIAS::BackwardMapping< unsigned char, float >::ClipValue_ ( const double &  value,
float &  newvalue 
) [inline, protected]

Definition at line 631 of file BackwardMapping.hh.

template<class InputStorageType , class OutputStorageType>
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::ClipValue_ ( const double &  value,
OutputStorageType &  newvalue 
) [inline, protected]

clip interpolated value to outputstoragetype and merge old and new value according to alpha

This function must be inplemented for diferent template types rather than for derived classes, e.g. if bicubic interpolation estimates the grey value 257.8 for an unsinged char image, this is rounded and clipped here to 255.0 since this is the maximum allowed uchar.

Definition at line 591 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::ComputeLocalPyramidLayer_ ( const HomgPoint2D p_sink,
double &  localscale 
) [inline, protected]

computes pyramid layer for trilinear filtering, e.g.

localscale 0.5 means best resolution and second best are averaged

Definition at line 360 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType >
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GenerateTestImage ( Image< InputStorageType > &  testimage,
bool  highFrequencyCross = true,
InputStorageType  dark = 5,
InputStorageType  bright = 127,
const Matrix3x3< double > &  Hinv = Matrix3x3<double>(MatrixIdentity) 
) [static]

generates a siemens star like test image with lots of different frequencies to test backward mapping

Parameters:
testimageinitialized image of user defined size which will be filled
highFrequencyCrossgenerates an additional high frequency line
darkblack image value, e.g. close to 0
darkwhite image value, e.g. close to 255
Hinvhomography to transform pattern (if desired)
Author:
koeser 10/2007

Definition at line 1958 of file BackwardMapping.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), and BIAS::ImageBase::IsEmpty().

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetAnisotropicImageValue_ ( const double &  xsource,
const double &  ysource,
Matrix2x2< double > &  Jacobian,
unsigned int  channel,
double &  thereturnvalue 
) [protected]

use jacobian of mapping function to do anisotropic antialiasing

Definition at line 933 of file BackwardMapping.cpp.

References BIAS::Matrix2x2< T >::EigenvalueDecomposition(), and BIAS::Matrix< T >::GetSystemMatrix().

template<class InputStorageType, class OutputStorageType>
virtual int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetBoundingBox ( unsigned int  ,
unsigned int  ,
unsigned int  sinkwidth,
unsigned int  sinkheight,
int &  tlx,
int &  tly,
int &  brx,
int &  bry 
) [inline, virtual]

calculates the bounding box in sink image, where to do the backward mapping.

The resulting coordinates can be negative ! The br position is the first pixel outside the region(as for a ROI). Implement this in a derived class for speeding up calculation.

Reimplemented in BIAS::AffineMapping< InputStorageType, OutputStorageType >, BIAS::HomographyMapping< InputStorageType, OutputStorageType >, and BIAS::TextureMapping< InputStorageType, OutputStorageType >.

Definition at line 248 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetDisplacementMap ( Image< float > &  dismap,
Image< InputStorageType > &  src 
)
template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetDisplacementMap ( Image< float > &  dismap,
int  width,
int  height 
)

precomputes lookup coordinates and computes displacement map int TEXTURE coordinates, according to the size of src (or width,height)

Definition at line 1080 of file BackwardMapping.cpp.

template<class InputStorageType, class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetImageValue_ ( const double &  xsource,
const double &  ysource,
const Image< InputStorageType > &  im,
unsigned int  channel,
double &  result 
) [inline, protected]
template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetJacobian ( const HomgPoint2D sink,
Matrix2x2< double > &  Jacobian 
) const [inline]

get jacobian (including concatenated mappings)

Definition at line 302 of file BackwardMapping.hh.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetJacobian_ ( const HomgPoint2D sink,
Matrix2x2< double > &  Jacobian 
) const [protected, virtual]

numeric approximation of jacobian, reimplement in derived class to make an analytic jacobian

Reimplemented in BIAS::AffineMapping< InputStorageType, OutputStorageType >, BIAS::HomographyMapping< InputStorageType, OutputStorageType >, and BIAS::TextureMapping< InputStorageType, OutputStorageType >.

Definition at line 67 of file BackwardMapping.cpp.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetLookupTable ( float *  lutImageRow,
InterpolationMethod  method 
)

Definition at line 1289 of file BackwardMapping.cpp.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetLookupTable ( const std::string &  filename,
InterpolationMethod  method 
)

Returns the LUT generated by PrepareLookupTableMapping() as an file.

Definition at line 1196 of file BackwardMapping.cpp.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetLookupTableSize ( unsigned int &  width,
unsigned int &  channels,
InterpolationMethod  method 
)

returns the size of the current LUT.

Returns:
-1 if the current InterpolationMethod has no LUT!

Definition at line 1150 of file BackwardMapping.cpp.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetSourceCoordinates ( const HomgPoint2D sink,
HomgPoint2D source 
) const [inline]

wrapper function to allow the lookup implementation to be shared with other algorithms.

Attention:
Do not reimplement this method in any child class implement into GetSourceCoordinates_().

Definition at line 272 of file BackwardMapping.hh.

Referenced by BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::Disp2Depth().

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetSourceCoordinates_ ( const HomgPoint2D sink,
HomgPoint2D source 
) const [protected, virtual]
template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetTrilinearImageValue_ ( const double &  xsource,
const double &  ysource,
const double &  scale,
unsigned int  channel,
double &  result 
) [protected]

worker function, which handles bilinear/bicubic interpolation, pyramid levels, borders and weights

Definition at line 868 of file BackwardMapping.cpp.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  sink,
InterpolationMethod  interpolationQuality = MapTrilinear,
bool  newSink = false,
double  SuperSampling = 1.0 
)

backward mapping with various interpolations

Sink must be initialized with correct size and background color for invalid pixels. This way you can call it several times to create a panorama from several source images. For each pixel in sink, GetSourceCoordinates is called and the value in source interpolated.

Parameters:
newSink,iftrue a new sink image is created that is large enough to hold the old sink and the new mapped src img.
SuperSamplingif > 1.0, intermediate image with isotropically enlarged width and height (by factor SuperSampling) is created and downsampled for the final image (most useful for nonlinear mappings)
Returns:
0 on success, >0 means notification(such as 1 = not all pixels could be computed), -1 means failure

Definition at line 226 of file BackwardMapping.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::IsPlanar(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map(), BIAS::AffineMapping< InputStorageType, OutputStorageType >::SetAffineTransformation(), and BIAS::ImageBase::SetZero().

Referenced by BIAS::ImageBlender::BlendImages(), BIAS::PMDImageProc::FitDepthTo2DImageHomogr_(), BIAS::PMDImageProc::FitDepthTo2DImageKOnly_(), and BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map().

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map ( Image< OutputStorageType > &  sink)

use this for subsequent calls to avoid pyramid recalculation when using tri-filtering

Definition at line 327 of file BackwardMapping.cpp.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::MapBi_ ( const Image< InputStorageType > &  source,
Image< OutputStorageType > &  sink,
InterpolationMethod  interpolationQuality 
) [protected]
template<class InputStorageType , class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::MapTri_ ( Image< OutputStorageType > &  sink) [protected]

map image avoiding aliasing

This is almost correct regarding the sampling theorem, because it uses trilinear or anisotropic filtering over a pyramid. The local sampling frequency is estimated by analyzing the jacobian of the homography as a R^2->R^2 mapping. This is very slow. If possible, bicubic interpolation is done in the image, at borders (high pyramid levels) only bilinear.
In auto mode pyramid size is checked

Author:
koeser 04/2005

Definition at line 492 of file BackwardMapping.cpp.

References BIAS::Image< StorageType >::FillImageWithConstValue(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), and BIAS::ImageBase::GetWidth().

template<class InputStorageType , class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::MapTrilinearGreySimple_ ( Image< OutputStorageType > &  sink) [protected]
template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::MapWithLookupTable ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  sink,
InterpolationMethod  method 
)
template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::PrepareLookupTableMapping ( const Image< InputStorageType > &  src,
Image< OutputStorageType > &  sink,
InterpolationMethod  method,
bool  newSink = false 
)
template<class InputStorageType, class OutputStorageType>
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::SetConcatenation ( BIAS::BackwardMapping< InputStorageType, OutputStorageType > *  pCon) [inline]

avoid intermediate image and concatenate two backward mappings

Imagine that the source image is transformed with pcon into the intermediate image, which is then transformed by this into the sink

Definition at line 319 of file BackwardMapping.hh.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::SetLookupTable ( const std::string &  filename,
InterpolationMethod &  method 
)

Loads the LUT from a file, replaces the call to PrepareLookupTableMapping().

Returns:
the interpolation type in the parameter named method stored in the passed file.

Definition at line 1342 of file BackwardMapping.cpp.

template<class InputStorageType , class OutputStorageType >
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::SetLookupTable ( const float *  lutImageRow,
unsigned int  width,
InterpolationMethod &  method 
)
template<class InputStorageType , class OutputStorageType >
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::SetPyramidSize ( const int  newsize)

sets pyramid size to pyramid and updates if neccessary

Definition at line 186 of file BackwardMapping.cpp.

template<class InputStorageType , class OutputStorageType>
void BIAS::BackwardMapping< InputStorageType, OutputStorageType >::UpdatePyramidSize ( const Image< OutputStorageType > &  sink) [virtual]

use coordinates from sink to estimate maximum pyramid level needed, update pyramid size

Bug:
projectionmapping failes if this function is called! (ischiller / 12.01.09)
Bug:
projectionmapping failes if this function is called! (ischiller / 12.01.09)

Definition at line 100 of file BackwardMapping.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Random::GetUniformDistributed(), and BIAS::ImageBase::GetWidth().


Member Data Documentation

template<class InputStorageType, class OutputStorageType>
bool BIAS::BackwardMapping< InputStorageType, OutputStorageType >::aliasing_ [protected]

set to true if possibility of aliasing is detected during mapping

Definition at line 502 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BIAS::Image<float> BIAS::BackwardMapping< InputStorageType, OutputStorageType >::alphaImg_ [protected]

has same size as overlap region used for blending

Definition at line 531 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
bool BIAS::BackwardMapping< InputStorageType, OutputStorageType >::autoPyramidSize_ [protected]

pyramid size set by user or computed automatically ?

Definition at line 484 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::BackwardMapping< InputStorageType, OutputStorageType >::height_ [protected]

source image height

Definition at line 528 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
bool BIAS::BackwardMapping< InputStorageType, OutputStorageType >::incomplete_ [protected]

set to true if not every pixel could be computed

Definition at line 505 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
InterpolationMethod BIAS::BackwardMapping< InputStorageType, OutputStorageType >::interpolationType_ [protected]

which interpolation method are we using

Definition at line 488 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::offsetX_ [protected]

needed for newDist

Definition at line 522 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::offsetY_ [protected]

Definition at line 522 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BackwardMapping<InputStorageType, OutputStorageType>* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pConcatenation_ [protected]

Definition at line 533 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BWM_LUT_Entry_Anisotropic* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Ani_ [protected]

NOT IMPLEMENTED (YET ?)

Definition at line 518 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BWM_LUT_Entry_Bicubic* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Bic_ [protected]

Definition at line 519 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BWM_LUT_Entry_Bilinear* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Bil_ [protected]

Definition at line 510 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Bil_size [protected]

Definition at line 514 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BWM_LUT_Entry_Nearest* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Nea_ [protected]

lookup-tables for precomputed positions in source, same size as dst.PixelCount

Definition at line 509 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Nea_size [protected]

Definition at line 513 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
BWM_LUT_Entry_Trilinear* BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Tri_ [protected]

Definition at line 511 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
int BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pLUT_Tri_size [protected]

Definition at line 515 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
PyramidImage<InputStorageType> BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pyramid_ [protected]

this contains a pyramid of the last source image for anti-aliasing

Definition at line 479 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
unsigned BIAS::BackwardMapping< InputStorageType, OutputStorageType >::pyramidSize_ [protected]

Definition at line 485 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
bool BIAS::BackwardMapping< InputStorageType, OutputStorageType >::rangeChecked_ [protected]

The interpolated value is computed in double; if clipped value is not specialized for your output storage type (e.g.

ushort), this boolean indicates that the generic conversion (e.g. double->ushort) could have introduced artefacts (65536.0 -> 1).

Definition at line 498 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
ROI BIAS::BackwardMapping< InputStorageType, OutputStorageType >::ROI_ [protected]

the roi of the last source image

Definition at line 481 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::BackwardMapping< InputStorageType, OutputStorageType >::superSampling_ [protected]

if larger than 1, super resolution is active

Definition at line 491 of file BackwardMapping.hh.

template<class InputStorageType, class OutputStorageType>
double BIAS::BackwardMapping< InputStorageType, OutputStorageType >::width_ [protected]

source image width

Definition at line 525 of file BackwardMapping.hh.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends