DriveWorks SDK Reference

| 0.6.67 Release

Pyramid

Detailed Description

Defines the image pyramid structure and functionality used for tracking.

Data Structures

struct  dwPyramidConfig
 Holds the configuration parameters for a pyramid. More...
 

Functions

DW_API_PUBLIC dwStatus dwPyramid_build (const dwImageCUDA *image, dwPyramidHandle_t obj)
 Builds the pyramid from the level 0 image. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getCUDAStream (cudaStream_t *stream, dwConstPyramidHandle_t obj)
 Gets the CUDA stream used by the pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getLevelCount (uint32_t *levelCount, dwConstPyramidHandle_t obj)
 Gets the number of levels in the pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getLevelData (uint8_t **d_data, size_t *strideBytes, const uint32_t level, dwPyramidHandle_t obj)
 Gets the data of a level in the pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getLevelImageCUDA (const dwImageCUDA **img, const uint32_t level, dwConstPyramidHandle_t obj)
 Gets the data of a level in the const pyramid as a dwImageCUDA. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getLevelSize (uint32_t *width, uint32_t *height, const uint32_t level, dwConstPyramidHandle_t obj)
 Gets the size of a level in the pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_initialize (dwPyramidHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const dwPyramidConfig config)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_release (dwPyramidHandle_t *obj)
 Releases the pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_reset (dwPyramidHandle_t obj)
 Resets a pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_setCUDAStream (cudaStream_t stream, dwPyramidHandle_t obj)
 Sets the CUDA stream for CUDA related operations. More...
 

Data Structure Documentation

◆ dwPyramidConfig

struct dwPyramidConfig
Data Fields
dwTrivialDataType dataType Data Type of pyramid.
uint32_t height Height of level 0.
uint32_t levelCount Number of levels in the pyramid.
uint32_t width Width of level 0.

Function Documentation

◆ dwPyramid_build()

DW_API_PUBLIC dwStatus dwPyramid_build ( const dwImageCUDA image,
dwPyramidHandle_t  obj 
)

Builds the pyramid from the level 0 image.

Parameters
[in]imageSpecifies the level 0 image.
[in]objSpecifies the pyramid handle where the pyramid will be built.
Returns
DW_INVALID_ARGUMENT if pyramid handle or image are NULL or pyramid handle is invalid.
DW_SUCCESS otherwise.

◆ dwPyramid_getCUDAStream()

DW_API_PUBLIC dwStatus dwPyramid_getCUDAStream ( cudaStream_t *  stream,
dwConstPyramidHandle_t  obj 
)

Gets the CUDA stream used by the pyramid.

Parameters
[out]streamThe CUDA stream currently used.
[in]objA handle to the pyramid module.
Returns
DW_INVALID_ARGUMENT if pyramid handle or stream are NULL.
DW_SUCCESS otherwise.

◆ dwPyramid_getLevelCount()

DW_API_PUBLIC dwStatus dwPyramid_getLevelCount ( uint32_t *  levelCount,
dwConstPyramidHandle_t  obj 
)

Gets the number of levels in the pyramid.

Parameters
[out]levelCountA pointer to the number of levels will be returned here.
[in]objSpecifies the pyramid handle.
Returns
DW_INVALID_ARGUMENT if pyramid handle or levelCount are NULL.
DW_SUCCESS otherwise.

◆ dwPyramid_getLevelData()

DW_API_PUBLIC dwStatus dwPyramid_getLevelData ( uint8_t **  d_data,
size_t *  strideBytes,
const uint32_t  level,
dwPyramidHandle_t  obj 
)

Gets the data of a level in the pyramid.

Parameters
[out]d_dataA GPU pointer to the data of the level.
[out]strideBytesA pointer to the stride of each row of the level data, in bytes.
[in]levelSpecifies the level number to get the data for.
[in]objSpecifies the pyramid handle.
Returns
DW_INVALID_ARGUMENT if pyramid handle, d_data or strideBytes are NULL or level is out of range.
DW_SUCCESS otherwise.

◆ dwPyramid_getLevelImageCUDA()

DW_API_PUBLIC dwStatus dwPyramid_getLevelImageCUDA ( const dwImageCUDA **  img,
const uint32_t  level,
dwConstPyramidHandle_t  obj 
)

Gets the data of a level in the const pyramid as a dwImageCUDA.

Parameters
[out]imgA pointer to a dwImageCUDA that maps to a level of the pyramid.
[in]levelSpecifies the level number to get the data for.
[in]objSpecifies the pyramid handle.
Returns
DW_INVALID_ARGUMENT if pyramid handle or img are NULL or level is out of range.
DW_SUCCESS otherwise.

◆ dwPyramid_getLevelSize()

DW_API_PUBLIC dwStatus dwPyramid_getLevelSize ( uint32_t *  width,
uint32_t *  height,
const uint32_t  level,
dwConstPyramidHandle_t  obj 
)

Gets the size of a level in the pyramid.

Parameters
[out]widthA pointer to the width of the level.
[out]heightA pointer to the height of the level.
[in]levelSpecifies the level number to get the size for.
[in]objSpecifies the pyramid handle.
Returns
DW_INVALID_ARGUMENT if pyramid handle, widht or height are NULL or level is out of range.
DW_SUCCESS otherwise.

◆ dwPyramid_initialize()

DW_API_PUBLIC dwStatus dwPyramid_initialize ( dwPyramidHandle_t obj,
dwContextHandle_t  context,
cudaStream_t  stream,
const dwPyramidConfig  config 
)

Creates and initializes an image pyramid.

Level 0 of the pyramid is of size config.width x config.height. It has config.levelCount number of levels. For each level, width[n] = (width[n-1]+1)/2.

Parameters
[out]objA pointer to the pyramid handle will be returned here.
[in]contextSpecifies the handle to the context under which it is created.
[in]streamSpecifies the CUDA stream to use for pyramid operations.
[in]configSpecifies the configuration parameters.
Returns
DW_INVALID_ARGUMENT if pyramid handle or context are NULL or config is invalid.
DW_SUCCESS otherwise.

◆ dwPyramid_release()

DW_API_PUBLIC dwStatus dwPyramid_release ( dwPyramidHandle_t obj)

Releases the pyramid.

This method releases all resources associated with a pyramid.

Note
This method renders the handle unusable.
Parameters
[in]objA pointer to the object handle to be released.
Returns
DW_INVALID_ARGUMENT if pyramid handle is NULL.
DW_SUCCESS otherwise.

◆ dwPyramid_reset()

DW_API_PUBLIC dwStatus dwPyramid_reset ( dwPyramidHandle_t  obj)

Resets a pyramid.

Parameters
[in]objSpecifies the pyramid handle to reset.
Returns
DW_INVALID_ARGUMENT if pyramid handle is NULL.
DW_SUCCESS otherwise.

◆ dwPyramid_setCUDAStream()

DW_API_PUBLIC dwStatus dwPyramid_setCUDAStream ( cudaStream_t  stream,
dwPyramidHandle_t  obj 
)

Sets the CUDA stream for CUDA related operations.

Note
The ownership of the stream remains by the callee.
Parameters
[in]streamThe CUDA stream to be used. Default is the one passed during dwPyramid_initialize.
[in]objA handle to the pyramid module to set CUDA stream for.
Returns
DW_INVALID_ARGUMENT if pyramid handle is NULL.
DW_SUCCESS otherwise.