VPI - Vision Programming Interface

3.0 Release

Types.h File Reference

Defines all types needed for programming with VPI. More...

#include "ImageFormat.h"
#include "Interpolation.h"
#include "PixelType.h"
#include "Status.h"
#include "Version.h"
#include <stdint.h>
+ Include dependency graph for Types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VPIParallelForConfig
 Stores the ParallelFor configuration. More...
 
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  VPIBriefDescriptor
 Stores a BRIEF Descriptor. 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  VPIKLTTrackedBoundingBox
 Stores a bounding box that is being tracked by KLT Tracker. More...
 
struct  VPIDCFTrackedBoundingBox
 Stores information about an object tracked by DCF Tracker. 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_BRIEF_DESCRIPTOR_ARRAY_LENGTH   32
 Length of Brief Descriptor Array.
 
#define VPI_BRIEF_DESCRIPTOR_BIT_WIDTH   (VPI_BRIEF_DESCRIPTOR_ARRAY_LENGTH * 8)
 Length of Brief Descriptor in bits.
 
#define VPI_MAX_MATCHES_PER_DESCRIPTOR   (3)
 Maximum number of matches per descriptor.
 
#define VPI_TERMINATION_CRITERIA_ITERATIONS   (1u << 0)
 Defines the termination criteria macros. More...
 
#define VPI_TERMINATION_CRITERIA_EPSILON   (1u << 1)
 Termination based on maximum error (epsilon).
 
#define VPI_STAT_PIXEL_COUNT   (1U << 0)
 Defines which statistics to be calculated. More...
 
#define VPI_STAT_SUM   (1U << 1)
 Calculate per-channel sum.
 
#define VPI_STAT_MEAN   ((1U << 2) | VPI_STAT_SUM | VPI_STAT_PIXEL_COUNT)
 Calculate per-channel mean.
 
#define VPI_STAT_VARIANCE   ((1U << 3) | VPI_STAT_MEAN)
 Calculate covariance matrix with variance of each channel.
 
#define VPI_STAT_COVARIANCE   ((1U << 4) | VPI_STAT_VARIANCE)
 Calculate full covariance matrix.
 
Common object flags.

These flags can be passed to the creation function of the following objects:

They might change some of the characteristics of the created object to conform to some expected behavior.

#define VPI_EXCLUSIVE_STREAM_ACCESS   (1ULL << 16)
 Specifies that the memory will be accessed by only one stream at a time. More...
 
#define VPI_RESTRICT_MEM_USAGE   (1ULL << 17)
 Flag to restrict memory resources usage. More...
 
#define VPI_REQUIRE_BACKENDS   (1ULL << 18)
 Require creation of requested backends. More...
 

Typedefs

typedef void(* VPIParallelTask) (int taskId, int threadId, void *vpiData)
 Parallel task function pointer type.
 
typedef void(* VPIParallelForCallback) (VPIParallelTask task, int taskCount, void *vpiData, void *userData)
 Parallel for callback function pointer type. More...
 
typedef void * VPINativeThreadHandle
 A handle to OS-specific thread handle.
 
typedef struct VPIArrayImpl * VPIArray
 A handle to an array.
 
typedef struct VPIContextImpl * VPIContext
 A handle to a context.
 
typedef struct VPIEventImpl * VPIEvent
 A handle to an event.
 
typedef struct VPIStreamImpl * VPIStream
 A handle to a stream.
 
typedef struct VPIImageImpl * VPIImage
 A handle to an image.
 
typedef struct VPIPyramidImpl * VPIPyramid
 A handle to an image pyramid.
 
typedef struct VPIPayloadImpl * VPIPayload
 A handle to an algorithm payload.
 
typedef float VPICameraIntrinsic[2][3]
 Camera intrinsic matrix. More...
 
typedef float VPICameraExtrinsic[3][4]
 Camera extrinsic matrix. More...
 
typedef float VPIPerspectiveTransform[3][3]
 Represents a 2D perspective transform. More...
 

Enumerations

enum  VPIBorderExtension
 Image border extension specify how pixel values outside of the image domain should be constructed. More...
 
enum  VPIConversionPolicy
 Policy used when converting between image types. More...
 
enum  VPICornerScore
 Defines different types of corner scores. More...
 
enum  VPITrackingState
 Object tracking state. 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...
 
enum  VPIFlipMode
 Defines image flip directions. More...
 
enum  VPINormType
 Defines the magnitude of vectors. More...
 
enum  VPIGradientMethod
 Different method to generate gradients. More...
 

Memory creation flags.

These flags can be used when creating images, pyramids or arrays.

#define VPI_BACKEND_TEGRA   (VPI_BACKEND_VIC | VPI_BACKEND_NVENC | VPI_BACKEND_OFA)
 Tegra-only backends.
 
#define VPI_BACKEND_MASK   ((VPI_BACKEND_INVALID << 1) - 1)
 Tegra-only backends.
 
#define VPI_BACKEND_ALL    (VPI_BACKEND_CPU | VPI_BACKEND_CUDA | VPI_BACKEND_PVA | VPI_BACKEND_VIC | VPI_BACKEND_NVENC | VPI_BACKEND_OFA)
 All backends.
 
enum  VPIBackend
 VPI Backend types. More...
 

Detailed Description

Defines all types needed for programming with VPI.

Definition in file Types.h.


Data Structure Documentation

◆ VPIBriefDescriptor

struct VPIBriefDescriptor

Stores a BRIEF Descriptor.

Definition at line 354 of file Types.h.

+ Collaboration diagram for VPIBriefDescriptor:
Data Fields
uint8_t data[VPI_BRIEF_DESCRIPTOR_ARRAY_LENGTH]

Macro Definition Documentation

◆ VPI_EXCLUSIVE_STREAM_ACCESS

#define VPI_EXCLUSIVE_STREAM_ACCESS   (1ULL << 16)

Specifies that the memory will be accessed by only one stream at a time.

By default memories are created up so that at multiple streams can access it for reading simultaneously. Doing so might incur in increased system resources utilization. By specifying this flag when creating a VPIImage, VPIArray or VPIPyramid, when it's known that they won't be used concurrently by different streams, better resource allocation is achieved.

Definition at line 136 of file Types.h.

◆ VPI_RESTRICT_MEM_USAGE

#define VPI_RESTRICT_MEM_USAGE   (1ULL << 17)

Flag to restrict memory resources usage.

When passed as flags to certain VPI functions, it will instruct them to use less memory resources, in exchange of limiting their functionality. Please refer to documentation of these functions for further explanation on the trade-offs involved.

Definition at line 146 of file Types.h.

◆ VPI_REQUIRE_BACKENDS

#define VPI_REQUIRE_BACKENDS   (1ULL << 18)

Require creation of requested backends.

With this flag set, the creation functions will require that the given backends are created. If any fail, the creation function will return an error. If not set, it'll try to enable the given backends, but disable the ones that are incompatible with the object parameters or not enabled in current context.

Note
When applied to a context, this flag isn't propagated to objects created when this context is active.

Definition at line 159 of file Types.h.

◆ VPI_STAT_PIXEL_COUNT

#define VPI_STAT_PIXEL_COUNT   (1U << 0)

Defines which statistics to be calculated.

Calculate pixel count

Definition at line 733 of file Types.h.

Enumeration Type Documentation

◆ VPICornerScore

Defines different types of corner scores.

Enumerator
VPI_CORNER_SCORE_HARRIS 

Use Harris response corner scores.

VPI_CORNER_SCORE_FAST 

Use FAST corner scores.

Definition at line 335 of file Types.h.

◆ VPITrackingState

Object tracking state.

Enumerator
VPI_TRACKING_STATE_LOST 

Object isn't being tracked anymore.

This state is either set by the user when this object doesn't need to be tracked anymore, or by the tracking function given some tracking confidence criteria. Existing objects with state VPI_TRACKING_STATE_LOST can be reused for new objects. The valid transitions from this state are:

VPI_TRACKING_STATE_NEW 

New object to be tracked.

This state is defined by the user for new objects to be tracked. The valid transitions from this state are:

VPI_TRACKING_STATE_TRACKED 

Object is being tracked with high confidence.

The object is being localized in the input frames and because there's a high confidence (established externally) that the bounding box is accurate, its internal model can be updated with the currently estimated position. The valid transitions from this state are:

VPI_TRACKING_STATE_SHADOW_TRACKED 

Object is being tracked with low confidence.

The object localized in the frame, but its model is not being updated because there's a low confidence on its bounding box location/size. The valid transitions from this state are:

Definition at line 424 of file Types.h.

◆ VPIFlipMode

Defines image flip directions.

This is used by algorithms such as Image Flip

Enumerator
VPI_FLIP_HORIZ 

Flip horizontally.

VPI_FLIP_VERT 

Flip vertically.

VPI_FLIP_BOTH 

Flip horizontally and vertically.

This effectively rotates the image 180 degrees.

Definition at line 686 of file Types.h.

◆ VPINormType

Defines the magnitude of vectors.

This is used by algorithms such as Canny edge detector

Enumerator
VPI_NORM_L1 

L1 norm.

VPI_NORM_L2 

L2 norm.

VPI_NORM_HAMMING 

Hamming norm.

Definition at line 704 of file Types.h.

◆ VPIGradientMethod

Different method to generate gradients.

Enumerator
VPI_GRADIENT_SOBEL 

Generate the gradient in x direction and y direction via sobel operator.

VPI_GRADIENT_BLUR_PREWITT 

Generate the gradient by using prewitt operator on blurred input image.

Definition at line 720 of file Types.h.