Defines the Dense Optical Flow module.
- Note
- SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.
|
DW_API_PUBLIC dwStatus | dwDenseOpticalFlow_bindInput (const dwImageHandle_t input, const dwImageHandle_t inputReference, dwDenseOpticalFlowHandle_t obj) |
| Binds the input images to dense optical flow. More...
|
|
DW_API_PUBLIC dwStatus | dwDenseOpticalFlow_bindOutput (dwImageHandle_t output, dwDenseOpticalFlowHandle_t obj) |
| Binds the output image that contains motion vectors. More...
|
|
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_process (dwDenseOpticalFlowStage stageToExecute, dwDenseOpticalFlowHandle_t obj) |
| Executes a given stage of the pipeline. 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...
|
|
◆ 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
|
◆ dwDenseOpticalFlowHandle_t
◆ 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 63 of file DenseOpticalFlow.h.
◆ dwDenseOpticalFlowStage
Dense Optical Flow Pipeline stages.
Enumerator |
---|
DW_DENSE_OPTICAL_FLOW_STAGE_VIC_ASYNC_PREPARE_DATA | Prepares data by converting pitch linear NvMedia image to block linear on VIC.
|
DW_DENSE_OPTICAL_FLOW_STAGE_NVENC_ASYNC_PROCESS | Estimates motion vectors on NVENC.
|
DW_DENSE_OPTICAL_FLOW_STAGE_PVA_ASYNC_POSTPROCESS | Refines motion vectors on PVA.
|
DW_DENSE_OPTICAL_FLOW_STAGE_GPU_ASYNC_POSTPROCESS | Extracts motion vectors on GPU.
|
DW_DENSE_OPTICAL_FLOW_STAGE_CPU_SYNC_PROCESS | Synchronizes the output.
|
Definition at line 58 of file DenseOpticalFlow_processpipeline.h.
◆ dwDenseOpticalFlow_bindInput()
Binds the input images to dense optical flow.
The optical flow will be estimated relative to reference.
- Parameters
-
[in] | input | Image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR |
[in] | inputReference | Reference image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
- Note
- InputRGBA and InputYUV420 are the same image in different formats.
-
InputReferenceRGBA and InputReferenceYUV420 are the same image in different formats.
◆ dwDenseOpticalFlow_bindOutput()
Binds the output image that contains motion vectors.
- Parameters
-
[in] | output | output Image of format DW_IMAGE_FORMAT_RG_UINT16. This image contains the motion vectors on each pixel, where R channel contains X dimension and G channel contains Y dimension. |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
◆ dwDenseOpticalFlow_calculateOpticalFlow()
Calculates Dense Optical Flow between input and inputReference.
- Parameters
-
[out] | output | Image 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] | input | Image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR |
[in] | inputReference | Reference image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
- Note
- output must be created via dwDenseOpticalFlow_createOutputImage.
◆ dwDenseOpticalFlow_getCUDAStream()
Gets the CUDA stream.
- Parameters
-
[out] | stream | The CUDA stream currently used. |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
◆ dwDenseOpticalFlow_getOutputImageProperties()
Returns the required output image properties.
- Parameters
-
[out] | outputProperties | Output image properties |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
◆ dwDenseOpticalFlow_initDefaultParams()
Initializes DenseOpticalFlow parameters with default values.
- Parameters
-
[out] | params | DenseOpticalFlow parameters. |
- Returns
- DW_SUCCESS, DW_INVALID_ARGUMENT
◆ dwDenseOpticalFlow_initialize()
Initializes Dense Optical Flow module.
- Parameters
-
[out] | obj | A pointer to DenseOpticalFlow handle to be initialized. |
[in] | params | DenseOpticalFlow parameters |
[in] | ctx | Specifies the handle to the context |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT
◆ dwDenseOpticalFlow_process()
Executes a given stage of the pipeline.
- Parameters
-
[in] | stageToExecute | stageToExecute Stage to execute. |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT
◆ dwDenseOpticalFlow_release()
Releases the DenseOpticalFlow module.
- Parameters
-
[in] | obj | The object handle to release. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
- Note
- This method renders the handle unusable.
◆ dwDenseOpticalFlow_reset()
Resets DenseOpticalFlow module.
- Parameters
-
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
◆ dwDenseOpticalFlow_setCUDAStream()
Sets the CUDA stream.
- Note
- The ownership of the stream remains by the callee.
- Parameters
-
[in] | stream | The CUDA stream to be used. Default is the stream 0, resulting in synchronous operations. |
[in] | obj | Specifies the DenseOpticalFlow handle. |
- Returns
- DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST