Image Component Library (ICL)
|
Operator that remaps an image with given look-up map. More...
#include <WarpOp.h>
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::Img32f & | getWarpMap () 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 |
Operator that remaps an image with given look-up map.
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.
Currently this Op does not provide ROI handling (although used IPP-functions do)
Support is purely optional and only defined in case of depth8u or depth32f input images
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 --------------------------------------------
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.
warpMap | map that contains new x-coortinates in the first channel and new y-coordinates in the 2nd one |
mode | interpolation mode either interpolateLIN or interpolateNN |
allowWarpMapScaling | if set to true, the WarpOp instance will internally create a scaled warp map in case of differing warp map and image size |
virtual void icl::filter::WarpOp::apply | ( | const core::ImgBase * | src, |
core::ImgBase ** | dst | ||
) | [virtual] |
virtual apply function
Implements icl::filter::UnaryOp.
bool icl::filter::WarpOp::getAllowWarpMapScaling | ( | ) | const [inline] |
returns whether warp map scaling is allowed
core::scalemode icl::filter::WarpOp::getScaleMode | ( | ) | const [inline] |
returns the current scalemode
const core::Img32f& icl::filter::WarpOp::getWarpMap | ( | ) | const [inline] |
returns the current warp map
void icl::filter::WarpOp::setAllowWarpMapScaling | ( | bool | allow | ) |
Sets the allow warp-map-scaling features.
void icl::filter::WarpOp::setScaleMode | ( | core::scalemode | scaleMode | ) |
Sets a new scalemode (either interpolateLIN or interpolateNN)
void icl::filter::WarpOp::setWarpMap | ( | const core::Img32f & | warpMap | ) |
Sets a new warp map.
bool icl::filter::WarpOp::m_allowWarpMapScaling [private] |
core::Img32f icl::filter::WarpOp::m_warpMap [private] |