VPI - Vision Programming Interface

3.0 Release

Common Types

Defines common types used by several components. More...

Data Structures

struct  VPIKeypointF32
 Stores a float32 keypoint coordinate The coordinate is relative to the top-left corner of an image. More...
 
struct  VPIKeypointU32
 Stores a U32 keypoint coordinate The coordinate is relative to the top-left corner of an image. More...
 
struct  VPIHomographyTransform2D
 Stores a generic 2D homography transform. More...
 
struct  VPIBoundingBox
 Stores a generic 2D bounding box. More...
 
struct  VPIAxisAlignedBoundingBoxF32
 Stores an axis-aligned 32-bit floating point 2D bounding box. More...
 
struct  VPIStats
 Stores the statistics of an image. More...
 
struct  VPIMatches
 Stores the matches between 2 descriptors. More...
 
struct  VPIRectangleI
 Stores the geometric information of a rectangle. More...
 

Macros

#define VPI_TERMINATION_CRITERIA_ITERATIONS   (1u << 0)
 Defines the termination criteria macros. More...
 

Enumerations

enum  VPIInterpolationType
 Interpolation types supported by several algorithms. More...
 
enum  VPIBorderExtension
 Image border extension specify how pixel values outside of the image domain should be constructed. More...
 
enum  VPIOpticalFlowQuality
 Defines the quality of the optical flow algorithm. More...
 
enum  VPILockMode
 Defines the lock modes used by memory lock functions. More...
 
enum  VPIEventState
 Defines the states of the event. More...
 

Detailed Description

Defines common types used by several components.


Data Structure Documentation

◆ VPIKeypointF32

struct VPIKeypointF32

Stores a float32 keypoint coordinate The coordinate is relative to the top-left corner of an image.

Definition at line 314 of file Types.h.

+ Collaboration diagram for VPIKeypointF32:
Data Fields
float x Keypoint's x coordinate.
float y Keypoint's y coordinate.

◆ VPIKeypointU32

struct VPIKeypointU32

Stores a U32 keypoint coordinate The coordinate is relative to the top-left corner of an image.

Definition at line 326 of file Types.h.

+ Collaboration diagram for VPIKeypointU32:
Data Fields
uint32_t x Keypoint's x coordinate.
uint32_t y Keypoint's y coordinate.

◆ VPIHomographyTransform2D

struct VPIHomographyTransform2D

Stores a generic 2D homography transform.

When only scale and translation transformation is needed, these parameters must be arranged in the matrix as follows:

\[ \begin{bmatrix} s_x & 0 & p_x \\ 0 & s_y & p_y \\ 0 & 0 & 1 \end{bmatrix} \]

Scaling \((s_x,s_y)\) is relative to the center of the patch, position \((p_x,p_y)\) is relative to the top-left of the image.

In the general case, given an homogeneous 2D point \(P(x,y,1)\) and the matrix \(M^{3x3}\), the Euclidean 2D point \(O(x,y)\) is defined as

\begin{align} T &= M \cdot P \\ O &= (T_x/T_z, T_y/T_z) \end{align}

Definition at line 383 of file Types.h.

+ Collaboration diagram for VPIHomographyTransform2D:
Data Fields
float mat3[3][3] 3x3 homogeneous matrix that defines the homography.

◆ VPIBoundingBox

struct VPIBoundingBox

Stores a generic 2D bounding box.

Although this structure can store a 2D bounding box transformed by any homography, sometimes it stores an axis-aligned bounding box. To retrieve it, do the following:

float x = xform.mat3[0][2];
float y = xform.mat3[1][2];
float w = width * xform.mat3[0][0];
float h = height * xform.mat3[1][1];
float width
Bounding box width.
Definition: Types.h:406
float height
Bounding box height.
Definition: Types.h:407
VPIHomographyTransform2D xform
Defines the bounding box top left corner and its homography.
Definition: Types.h:405
float mat3[3][3]
3x3 homogeneous matrix that defines the homography.
Definition: Types.h:385

Definition at line 403 of file Types.h.

+ Collaboration diagram for VPIBoundingBox:
Data Fields
VPIHomographyTransform2D xform Defines the bounding box top left corner and its homography.
float width Bounding box width.
float height Bounding box height.

◆ VPIAxisAlignedBoundingBoxF32

struct VPIAxisAlignedBoundingBoxF32

Stores an axis-aligned 32-bit floating point 2D bounding box.

Definition at line 415 of file Types.h.

+ Collaboration diagram for VPIAxisAlignedBoundingBoxF32:
Data Fields
float left Defines the bounding box's left corner's coordinate.
float top Defines the bounding box's top corner's coordinate.
float width Bounding box width.
float height Bounding box height.

◆ VPIStats

struct VPIStats

Stores the statistics of an image.

Definition at line 525 of file Types.h.

+ Collaboration diagram for VPIStats:
Data Fields
float mean[4] Per channel mean.
float covariance[4][4] Per-channel covariance matrix, the square root of the diagonal is the standard deviation.
int32_t pixelCount Total pixel count.
float sum[4] Per channel sum.

◆ VPIMatches

struct VPIMatches

Stores the matches between 2 descriptors.

Definition at line 551 of file Types.h.

+ Collaboration diagram for VPIMatches:
Data Fields
int refIndex[VPI_MAX_MATCHES_PER_DESCRIPTOR] Match reference index.
float distance[VPI_MAX_MATCHES_PER_DESCRIPTOR] Distance between query and reference descriptor.

◆ VPIRectangleI

struct VPIRectangleI

Stores the geometric information of a rectangle.

Definition at line 565 of file Types.h.

+ Collaboration diagram for VPIRectangleI:
Data Fields
int32_t x
int32_t y
int32_t width
int32_t height

Macro Definition Documentation

◆ VPI_TERMINATION_CRITERIA_ITERATIONS

#define VPI_TERMINATION_CRITERIA_ITERATIONS   (1u << 0)

#include </opt/nvidia/vpi3/include/vpi/Types.h>

Defines the termination criteria macros.

Termination based on maximum number of iterations.

Definition at line 616 of file Types.h.

Enumeration Type Documentation

◆ VPIInterpolationType

#include </opt/nvidia/vpi3/include/vpi/Interpolation.h>

Interpolation types supported by several algorithms.

Enumerator
VPI_INTERP_NEAREST 

Nearest neighbor interpolation.

\[ P(x,y) = \mathit{in}[\lfloor x+0.5 \rfloor, \lfloor y+0.5 \rfloor] \]

VPI_INTERP_LINEAR 

Linear interpolation.

Interpolation weights are defined as:

\begin{align*} w_0(t)& \triangleq t-\lfloor t \rfloor \\ w_1(t)& \triangleq 1 - w_0(t) \\ \end{align*}

Bilinear-interpolated value is given by the formula below:

\[ P(x,y) = \sum_{p=0}^1 \sum_{q=0}^1 \mathit{in}[\lfloor x \rfloor+p, \lfloor y \rfloor+q]w_p(x)w_q(y) \]

VPI_INTERP_CATMULL_ROM 

Catmull-Rom cubic interpolation.

Catmull-Rom interpolation weights with \(A=-0.5\) are defined as follows:

\begin{eqnarray*} w_0(t) &\triangleq& A(t+1)^3 &-& 5A(t+1)^2 &+& 8A(t+1) &-& 4A \\ w_1(t) &\triangleq& (A+2)t^3 &-& (A+3)t^2 &\nonumber& &+& 1 \\ w_2(t) &\triangleq& (A+2)(1-t)^3 &-& (A+3)(1-t)^2 &\nonumber& &+& 1 \\ w_3(t) &\triangleq& \rlap{1 - w_0(t) - w_1(t) - w_2(t) } \end{eqnarray*}

Bicubic-interpolated value is given by the formula below:

\[ P(x,y) = \sum_{p=-1}^2 \sum_{q=-1}^2 \mathit{in}[\lfloor x \rfloor+p, \lfloor y \rfloor+q]w_p(x)w_q(y) \]

Definition at line 69 of file Interpolation.h.

◆ VPIBorderExtension

#include </opt/nvidia/vpi3/include/vpi/Types.h>

Image border extension specify how pixel values outside of the image domain should be constructed.

Enumerator
VPI_BORDER_ZERO 

All pixels outside the image are considered to be zero.

VPI_BORDER_CLAMP 

Border pixels are repeated indefinitely.

VPI_BORDER_REFLECT 

edcba|abcde|edcba

VPI_BORDER_MIRROR 

dedcb|abcde|dcbab

VPI_BORDER_LIMITED 

Consider image as limited to not access outside pixels.

VPI_BORDER_INVALID 

Invalid border.

Definition at line 276 of file Types.h.

◆ VPIOpticalFlowQuality

#include </opt/nvidia/vpi3/include/vpi/Types.h>

Defines the quality of the optical flow algorithm.

Enumerator
VPI_OPTICAL_FLOW_QUALITY_LOW 

Fast but low quality optical flow implementation.

VPI_OPTICAL_FLOW_QUALITY_MEDIUM 

Speed and quality in between of VPI_OPTICAL_FLOW_QUALITY_LOW and VPI_OPTICAL_FLOW_QUALITY_HIGH.

VPI_OPTICAL_FLOW_QUALITY_HIGH 

Slow but high quality optical flow implementation.

Definition at line 575 of file Types.h.

◆ VPILockMode

#include </opt/nvidia/vpi3/include/vpi/Types.h>

Defines the lock modes used by memory lock functions.

Enumerator
VPI_LOCK_READ 

Lock memory only for reading.

Writing to the memory when locking for reading leads to undefined behavior.

VPI_LOCK_WRITE 

Lock memory only for writing.

Reading to the memory when locking for reading leads to undefined behavior. It is expected that the whole memory is written to. If there are regions not written, it might not be updated correctly during unlock. In this case, it's better to use VPI_LOCK_READ_WRITE.

It might be slightly efficient to lock only for writing, specially when performing non-shared memory mapping.

VPI_LOCK_READ_WRITE 

Lock memory for reading and writing.

Definition at line 591 of file Types.h.

◆ VPIEventState

#include </opt/nvidia/vpi3/include/vpi/Types.h>

Defines the states of the event.

Enumerator
VPI_EVENT_STATE_NOT_SIGNALED 

Event is not signaled yet.

VPI_EVENT_STATE_SIGNALED 

Event has been signaled.

Definition at line 673 of file Types.h.