VPI - Vision Programming Interface

0.3.7 Release

Perspective Image Warp

Macros

#define VPI_WARP_INVERSE   (1)
 Flag to inform that the matrix used in warp operation is already inverted. More...
 

Typedefs

typedef float VPIPerspectiveTransform[3][3]
 Represents a 2D perspective transform. More...
 

Functions

VPIStatus vpiCreatePerspectiveImageWarp (VPIStream stream, VPIPayload *payload)
 Creates a payload for Perspective Image Warp algorithm. More...
 
VPIStatus vpiSubmitPerspectiveImageWarp (VPIPayload payload, VPIImage input, const VPIPerspectiveTransform xform, VPIImage output, VPIInterpolationType interp, VPIBoundaryCond bcond, uint32_t flags)
 Submits the Perspective Image Warp operation to the stream associated with the payload. More...
 

Detailed Description

Perspective Image Warp

Macro Definition Documentation

◆ VPI_WARP_INVERSE

#define VPI_WARP_INVERSE   (1)

#include <vpi/algo/PerspectiveImageWarp.h>

Flag to inform that the matrix used in warp operation is already inverted.

If user has the transform matrix already inverted, setting this flag allows the warp operation to use it directly instead of inverting it itself prior processing. This is particularly useful if matrix inversion would result in large numerical errors, such as when its determinant is close to zero.

Definition at line 86 of file PerspectiveImageWarp.h.

Typedef Documentation

◆ VPIPerspectiveTransform

typedef float VPIPerspectiveTransform[3][3]

#include <vpi/Types.h>

Represents a 2D perspective transform.

[vx]   [a11 a12 tx] [ux]
[vy] = [a21 a22 ty] [uy]
[vw]   [ p0  p1  p] [ 1]
u'x  = vx/vw
u'y  = vy/vw

In these equations,

  • ux, uy are the inhomogeneous coordinates in the source image.
  • u'x, u'y are the inhomogeneous coordinates in the destination image.
  • vx,vy,vw are the homogeneous coordinates in the destination image.
  • a11,a12,a21,a22 are the2x2 non-singular matrix with the linear component of the transform.
  • tx,ty is the translation component of the transform.
  • p0,p1,p are the projective components of the transform. p is usually 1.

Definition at line 608 of file Types.h.

Function Documentation

◆ vpiCreatePerspectiveImageWarp()

VPIStatus vpiCreatePerspectiveImageWarp ( VPIStream  stream,
VPIPayload payload 
)

#include <vpi/algo/PerspectiveImageWarp.h>

Creates a payload for Perspective Image Warp algorithm.

This function allocates all resources needed by the algorithm and ties the returned payload to the given stream.

Parameters
stream[in] VPI stream the algorithm will be submitted to.
payload[out] Pointer to a payload handle with the created payload.
Returns
VPI_SUCCESS if payload was created successfully, or some other VPIStatus value in case of error.

◆ vpiSubmitPerspectiveImageWarp()

VPIStatus vpiSubmitPerspectiveImageWarp ( VPIPayload  payload,
VPIImage  input,
const VPIPerspectiveTransform  xform,
VPIImage  output,
VPIInterpolationType  interp,
VPIBoundaryCond  bcond,
uint32_t  flags 
)

#include <vpi/algo/PerspectiveImageWarp.h>

Submits the Perspective Image Warp operation to the stream associated with the payload.

Parameters
payload[in] Payload created by vpiCreatePerspectiveImageWarp.
input[in] Input image to be warped.
xform[in] Transform to be applied.
output[out] Output image where warped image is written to.
interp[in] Interpolation mode to be used. Valid values:
bcond[in] Boundary condition to use for samples that fall outsize input's bounds. Value values:
flags[in] Flags to modify algorithm behavior. Valid values:
  • 0: default, transform isn't inverted, algorithm shall invert it.
  • VPI_WARP_INVERSE: transform is already inverted, algorithm can use it directly.
Returns
VPI_SUCCESS if algorithm was submitted successfully, or some other VPIStatus value in case of error. Some errors will only be reported asynchronously by synchronization functions or subsequent algorithm submissions.