Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::filter::WarpOp Class Reference

Operator that remaps an image with given look-up map. More...

#include <WarpOp.h>

Inheritance diagram for icl::filter::WarpOp:
icl::filter::UnaryOp icl::utils::Configurable

List of all members.

Public Member Functions

 WarpOp (const core::Img32f &warpMap=core::Img32f(), core::scalemode mode=core::interpolateLIN, bool allowWarpMapScaling=true)
 create a new WarpOp instance
void setScaleMode (core::scalemode scaleMode)
 Sets a new scalemode (either interpolateLIN or interpolateNN)
void setWarpMap (const core::Img32f &warpMap)
 Sets a new warp map.
void setAllowWarpMapScaling (bool allow)
 Sets the allow warp-map-scaling features.
core::scalemode getScaleMode () const
 returns the current scalemode
const core::Img32fgetWarpMap () const
 returns the current warp map
bool getAllowWarpMapScaling () const
 returns whether warp map scaling is allowed
virtual void apply (const core::ImgBase *src, core::ImgBase **dst)
 virtual apply function

Private Attributes

bool m_allowWarpMapScaling
core::Img32f m_warpMap
core::Img32f m_scaledWarpMap
core::scalemode m_scaleMode

Detailed Description

Operator that remaps an image with given look-up map.

Overview

A 'Warping' operation on images is any operation, that works on the local domain of the image i.e. it moves the images pixel locations. Special warping routines like affine operations (see AffineOp) can be performed using a functional rule that is applied on each destination pixel to determine it's corresponding source pixels (using the AffineOp example again, this function might be e.g. an affine matrix multiplication). If the mapping function gets more complex (e.g. in case of camera lens distortion), computation might become too slow, however computational performance even for most complex mappings can be limited by pre-calculating a so-called warp-table (a 2-channel 2D-look-up-table, that contains the result of the mapping for each pixel). Once having obtained such a LUT, a WarpOp will help to apply the table lookup operation conveniently and safely.

Region of Interest (ROI)

Currently this Op does not provide ROI handling (although used IPP-functions do)

Intel IPP

Support is purely optional and only defined in case of depth8u or depth32f input images

Performance

As already mentioned, the operation performance does not depend on the mapping function at all. Hence there're only few parameters, that influence the apply time of a WarpOp instance:

Here's a short list of benchmarks. For benchmarking your system, you can use the icl-warp-op-test application.

        System: 2.0 GHz Core2Duo
        Size:   640x480 (VGA)
        Build-flags: -O4 -march=native -funroll-loops
         interpolation:   NN             LINEAR
        --------------------------------------------

  • depth8u: 8ms(IPP) 13ms(IPP)
  • depth16s: 42ms 79ms
  • depth32s: 46ms 79ms
  • depth32f: 13ms(IPP) 20ms(IPP)
  • depth64f: 54ms 92ms
        

Constructor & Destructor Documentation

icl::filter::WarpOp::WarpOp ( const core::Img32f warpMap = core::Img32f(),
core::scalemode  mode = core::interpolateLIN,
bool  allowWarpMapScaling = true 
) [explicit]

create a new WarpOp instance

This constructor has been made explicit to avoid ambiguity in case of calling WarpOp(ImgQ()) or something like that.

Parameters:
warpMapmap that contains new x-coortinates in the first channel and new y-coordinates in the 2nd one
modeinterpolation mode either interpolateLIN or interpolateNN
allowWarpMapScalingif set to true, the WarpOp instance will internally create a scaled warp map in case of differing warp map and image size

Member Function Documentation

virtual void icl::filter::WarpOp::apply ( const core::ImgBase src,
core::ImgBase **  dst 
) [virtual]

virtual apply function

Implements icl::filter::UnaryOp.

returns whether warp map scaling is allowed

returns the current scalemode

const core::Img32f& icl::filter::WarpOp::getWarpMap ( ) const [inline]

returns the current warp map

Sets the allow warp-map-scaling features.

See also:
WarpOp(const Img32f&,scalemode,bool)

Sets a new scalemode (either interpolateLIN or interpolateNN)

void icl::filter::WarpOp::setWarpMap ( const core::Img32f warpMap)

Sets a new warp map.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines