IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Elastic Warp 2d
imageelasticWarp2dImg (inImg,inDxImg,inDyImg)
imageelasticWarp2dImg (inImg,inDxImg,inDyImg,interpolationPolicy)
imageelasticWarp2dImg (inImg,inFlowImg)
imageelasticWarp2dImg (inImg,inFlowImg,interpolationPolicy)

Detailed Description

Apply a generic motion field to an image.

This algorithm transforms the input image according to the input motion field. Hence, the supported displacement is totally generic and is not limited to a rigid or an affine transform. The motion field contains the displacement at each pixel of the input image and can be passed as 2 distinct images or as a two-framed sequence image. In the case of a sequence image, the first frame is the displacement along the x direction and the second frame is the displacement along the y direction.

The motion field is expressed as:

\[ OutImg[x, y] = InImg[x+DxImg[x, y], y+DyImg[x, y]] \]

Here is an example of deformation:

elasticWarp2dImg_result.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans

Code Example

# load input image from file
inImg = PyIPSDK.loadTiffImageFile(os.path.join(utImagesCommonPath, "Lena_510x509_UInt8.tif"))
flowImg = PyIPSDK.loadTiffImageFile(os.path.join(utImagesPath, "elasticFlow2d.tif"))
# apply image flipping along x-axis
outImg = gtrans.elasticWarp2dImg(inImg, flowImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLGeometricTransform/Processor/ElasticWarp2dImg/ElasticWarp2dImg.h>

Code Example

// Process the operation
// Please, note that the flow can be passed as a sequence image
// where dx is the first frame and dy is the second frame
ImagePtr pOutImg = elasticWarp2dImg(pInImg, pDxImg, pDyImg, interpPolicy);