DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Dense Optical Flow Interface

Detailed Description

Defines the Dense Optical Flow module.

Data Structures

struct  dwDenseOpticalFlowParams
 Dense Optical Flow parameters. More...
 

Typedefs

typedef struct dwDenseOpticalFlowObject * dwDenseOpticalFlowHandle_t
 Handle to a DenseOpticalFlow object. More...
 

Enumerations

enum  dwDenseOpticalFlowMode {
  DW_DENSE_OPTICAL_FLOW_MODE_HIGH_PERFORMANCE = 0,
  DW_DENSE_OPTICAL_FLOW_MODE_ULTRA_HIGH_PERFORMANCE = 1,
  DW_DENSE_OPTICAL_FLOW_MODE_HIGH_QUALITY = 2
}
 

Functions

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_calculateOpticalFlow (dwImageHandle_t output, const dwImageHandle_t input, const dwImageHandle_t inputReference, dwDenseOpticalFlowHandle_t obj)
 Calculates Dense Optical Flow between input and inputReference. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_getCUDAStream (cudaStream_t *stream, dwDenseOpticalFlowHandle_t obj)
 Gets the CUDA stream. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_getOutputImageProperties (dwImageProperties *outputProperties, dwDenseOpticalFlowHandle_t obj)
 Returns the required output image properties. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_initDefaultParams (dwDenseOpticalFlowParams *params)
 Initializes DenseOpticalFlow parameters with default values. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_initialize (dwDenseOpticalFlowHandle_t *obj, const dwDenseOpticalFlowParams *params, dwContextHandle_t ctx)
 Initializes Dense Optical Flow module. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_release (dwDenseOpticalFlowHandle_t obj)
 Releases the DenseOpticalFlow module. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_reset (dwDenseOpticalFlowHandle_t obj)
 Resets DenseOpticalFlow module. More...
 
DW_API_PUBLIC dwStatus dwDenseOpticalFlow_setCUDAStream (cudaStream_t stream, dwDenseOpticalFlowHandle_t obj)
 Sets the CUDA stream. More...
 

Data Structure Documentation

◆ dwDenseOpticalFlowParams

struct dwDenseOpticalFlowParams
Data Fields
dwDenseOpticalFlowMode estimationMode Estimation mode that determines the speed and quality of the optical flow.
uint32_t imageHeight Input image height.
uint32_t imageWidth Input image width.
dwProcessorType processorNVENC Indicates which NVENC the corresponding part of the pipeline to be executed.

Valid options are DW_PROCESSOR_TYPE_NVENC_0, DW_PROCESSOR_TYPE_NVENC_1

dwProcessorType processorPVA Indicates which PVA the corresponding part of the pipeline to be executed.

Valid options are DW_PROCESSOR_TYPE_PVA_0, DW_PROCESSOR_TYPE_PVA_1

Typedef Documentation

◆ dwDenseOpticalFlowHandle_t

typedef struct dwDenseOpticalFlowObject* dwDenseOpticalFlowHandle_t

Handle to a DenseOpticalFlow object.

Definition at line 59 of file DenseOpticalFlow.h.

Enumeration Type Documentation

◆ dwDenseOpticalFlowMode

Enumerator
DW_DENSE_OPTICAL_FLOW_MODE_HIGH_PERFORMANCE 

High performance with lower quality.

DW_DENSE_OPTICAL_FLOW_MODE_ULTRA_HIGH_PERFORMANCE 

Ultra high performance with lowest quality.

DW_DENSE_OPTICAL_FLOW_MODE_HIGH_QUALITY 

High quality with low performance.

Definition at line 61 of file DenseOpticalFlow.h.

Function Documentation

◆ dwDenseOpticalFlow_calculateOpticalFlow()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_calculateOpticalFlow ( dwImageHandle_t  output,
const dwImageHandle_t  input,
const dwImageHandle_t  inputReference,
dwDenseOpticalFlowHandle_t  obj 
)

Calculates Dense Optical Flow between input and inputReference.

Parameters
[out]outputImage of format DW_IMAGE_FORMAT_RG_INT16 where R channel contains X coordinates and G channel contains Y coordinates of a motion vector for each pixel. Output image is owned by the application.
[in]inputImage of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR
[in]inputReferenceReference image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR
[in]objSpecifies the DenseOpticalFlow handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
Note
output must be created via dwDenseOpticalFlow_createOutputImage.

◆ dwDenseOpticalFlow_getCUDAStream()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_getCUDAStream ( cudaStream_t *  stream,
dwDenseOpticalFlowHandle_t  obj 
)

Gets the CUDA stream.

Parameters
[out]streamThe CUDA stream currently used.
[in]objSpecifies the DenseOpticalFlow handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwDenseOpticalFlow_getOutputImageProperties()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_getOutputImageProperties ( dwImageProperties outputProperties,
dwDenseOpticalFlowHandle_t  obj 
)

Returns the required output image properties.

Parameters
[out]outputPropertiesOutput image properties
[in]objSpecifies the DenseOpticalFlow handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwDenseOpticalFlow_initDefaultParams()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_initDefaultParams ( dwDenseOpticalFlowParams params)

Initializes DenseOpticalFlow parameters with default values.

Parameters
[out]paramsDenseOpticalFlow parameters.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

◆ dwDenseOpticalFlow_initialize()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_initialize ( dwDenseOpticalFlowHandle_t obj,
const dwDenseOpticalFlowParams params,
dwContextHandle_t  ctx 
)

Initializes Dense Optical Flow module.

Parameters
[out]objA pointer to DenseOpticalFlow handle to be initialized.
[in]paramsDenseOpticalFlow parameters
[in]ctxSpecifies the handle to the context
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwDenseOpticalFlow_release()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_release ( dwDenseOpticalFlowHandle_t  obj)

Releases the DenseOpticalFlow module.

Parameters
[in]objThe object handle to release.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
Note
This method renders the handle unusable.

◆ dwDenseOpticalFlow_reset()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_reset ( dwDenseOpticalFlowHandle_t  obj)

Resets DenseOpticalFlow module.

Parameters
[in]objHandle to reset.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwDenseOpticalFlow_setCUDAStream()

DW_API_PUBLIC dwStatus dwDenseOpticalFlow_setCUDAStream ( cudaStream_t  stream,
dwDenseOpticalFlowHandle_t  obj 
)

Sets the CUDA stream.

Note
The ownership of the stream remains by the callee.
Parameters
[in]streamThe CUDA stream to be used. Default is the stream 0, resulting in synchronous operations.
[in]objSpecifies the DenseOpticalFlow handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST