Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CImageMapper Class Referenceabstract

Class for efficient application of arbitrary 2D-2D transformations to whole images. More...

#include <ImageMapper.h>

Inheritance diagram for CImageMapper:
Inheritance graph
[legend]

Classes

struct  MapCoordinates
 

Public Member Functions

 CImageMapper (bool bInterpolate=true)
 The only constructor of this class. More...
 
void ComputeMap (int width, int height)
 This method initializes the instance for mapping of images of a specific size. More...
 
void PerformMapping (const CByteImage *pInputImage, CByteImage *pOutputImage)
 This method performs the mapping. More...
 
virtual ~CImageMapper ()
 The destructor. More...
 

Private Member Functions

virtual void ComputeOriginalCoordinates (const Vec2d &newCoordinates, Vec2d &originalCoordinates)=0
 

Private Attributes

int height
 
bool m_bInterpolate
 
bool m_bMapComputed
 
MapCoordinatesm_pCoordinateMap
 
int * m_pOffsetMap
 
int width
 

Detailed Description

Class for efficient application of arbitrary 2D-2D transformations to whole images.

This class performs arbitrary 2D-2D transformations on instances of CByteImage. The 2D-2D transformation of interest must be specified by the inheriting class by implementing only (pure) virtual method: ComputeOriginalCoordinates(const Vec2d&, Vec2d&).

For initialization the method ComputeMap(int, int) must be called. Throughout initialization, an internal lookup table is built, including pre-computed coefficients for bilinear interpolation if the interpolation flag was set to true in the constructor CImageMapper(bool).

Bilinear interpolation has been optimized with integer arithmetics.

After initialization, the mapping is performed by calling the method PerformMapping(const CByteImage*, CByteImage*).

Images of type CByteImage::eGrayScale and CByteImage::eRGB24 are supported.

Definition at line 76 of file ImageMapper.h.

Constructor & Destructor Documentation

CImageMapper::CImageMapper ( bool  bInterpolate = true)

The only constructor of this class.

Initialization is performed by calling the method ComputeMap(int, int).

Parameters
[in]bInterpolateIf set to true (default value) coefficients for bilinear interpolation are pre-computed throughout the initialization process and bilinear interpolation is performed when calling the method PerformMapping(const CByteImage*, CByteImage*). Bilinear interpolation has been optimized with integer arithmetics. If set to false, no interpolation takes place.

Definition at line 64 of file ImageMapper.cpp.

CImageMapper::~CImageMapper ( )
virtual

The destructor.

Does not need to be implemented by the inheriting class.

Definition at line 76 of file ImageMapper.cpp.

Member Function Documentation

void CImageMapper::ComputeMap ( int  width,
int  height 
)

This method initializes the instance for mapping of images of a specific size.

This method must be called prior to use of PerformMapping(const CByteImage*, CByteIamge*). an internal lookup table is built, including pre-computed coefficients for bilinear interpolation if the interpolation flag was set to true in the constructor CImageMapper(bool).

Parameters
[in]widthThe width of the images to be mapped in pixels.
[in]heightThe height of the images to be mapped in pixels.

Definition at line 90 of file ImageMapper.cpp.

virtual void CImageMapper::ComputeOriginalCoordinates ( const Vec2d newCoordinates,
Vec2d originalCoordinates 
)
privatepure virtual
void CImageMapper::PerformMapping ( const CByteImage pInputImage,
CByteImage pOutputImage 
)

This method performs the mapping.

Before application of this method, the instance must have been initialized by calling the method ComputeMap(int, int).

The width and height of pInputImage and pOutputImage must match.
pInputImage and pOutputImage must be either both of type CByteImage::eGrayScale or both of type CByteImage::eRGB24.

Parameters
[in]pInputImageThe input image.
[out]pOutputImageThe output image.

Definition at line 171 of file ImageMapper.cpp.

Member Data Documentation

int CImageMapper::height
private

Definition at line 136 of file ImageMapper.h.

bool CImageMapper::m_bInterpolate
private

Definition at line 143 of file ImageMapper.h.

bool CImageMapper::m_bMapComputed
private

Definition at line 144 of file ImageMapper.h.

MapCoordinates* CImageMapper::m_pCoordinateMap
private

Definition at line 140 of file ImageMapper.h.

int* CImageMapper::m_pOffsetMap
private

Definition at line 139 of file ImageMapper.h.

int CImageMapper::width
private

Definition at line 136 of file ImageMapper.h.


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


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28