DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Pyramid Interface

Detailed Description

Defines the image pyramid structure.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwPyramidImage
 Pyramid image structure. More...
 
struct  dwPyramidImageProperties
 Pyramid image properties structure. More...
 
struct  dwPyramidPVAParams
 Image pyramid Parameters parameters. More...
 

Macros

#define DW_PYRAMID_LEVEL_MAX_COUNT   16
 
#define DW_PYRAMID_LEVEL_MAX_COUNT   16
 

Typedefs

typedef struct dwPyramidPVAObject * dwPyramidPVAHandle_t
 Handle to a Pyramid object. More...
 

Functions

DW_API_PUBLIC dwStatus dwImageFilter_computePyramid (dwPyramidImage *pyramid, const dwImageCUDA *image, cudaStream_t stream, dwContextHandle_t context)
 Builds the pyramid from level 0 image. More...
 
DW_API_PUBLIC dwStatus dwPyramid_create (dwPyramidImage *pyramid, uint32_t levelCount, uint32_t width, uint32_t height, dwTrivialDataType pxlType, dwContextHandle_t context)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_createFromProperties (dwPyramidImage *pyramid, dwPyramidImageProperties props, dwContextHandle_t context)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramid_destroy (dwPyramidImage pyramid)
 Destroy pyramid images. More...
 
DW_API_PUBLIC dwStatus dwPyramid_fillProperties (dwPyramidImageProperties *props, uint32_t levelCount, uint32_t width, uint32_t height, dwTrivialDataType pxlType)
 Fills the pyramid image properties structure. More...
 
DW_API_PUBLIC dwStatus dwPyramid_getProperties (dwPyramidImageProperties *props, dwPyramidImage *pyramid, dwContextHandle_t context)
 Gets the properties of a pyramid image. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_computePyramid (dwPyramidImage *pyramid, const dwImageHandle_t image, cudaStream_t stream, dwPyramidPVAHandle_t obj)
 Builds the pyramid from level 0 image. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_create (dwPyramidImage *pyramid, uint32_t levelCount, uint32_t width, uint32_t height, dwTrivialDataType pxlType, dwContextHandle_t context)
 Creates and initializes an image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_destroy (dwPyramidImage *pyramid)
 Destroy pyramid images. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_getCUDAStream (cudaStream_t *stream, dwPyramidPVAHandle_t obj)
 Get CUDA Stream to the used. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_initDefaultParams (dwPyramidPVAParams *params)
 Initializes default parameters for image pyramid with default values. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_initialize (dwPyramidPVAHandle_t *obj, dwPyramidPVAParams *params, dwContextHandle_t context)
 Initialize parameters for image pyramid. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_release (dwPyramidPVAHandle_t obj)
 Release Pyramid module. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_reset (dwPyramidPVAHandle_t obj)
 Resets Pyramid module. More...
 
DW_API_PUBLIC dwStatus dwPyramidPVA_setCUDAStream (cudaStream_t stream, dwPyramidPVAHandle_t obj)
 Sets CUDA Stream to the given stream. More...
 

Data Structure Documentation

◆ dwPyramidImage

struct dwPyramidImage
Data Fields
uint32_t levelCount number of level images in pyramid
dwImageHandle_t levelImages[DW_PYRAMID_LEVEL_MAX_COUNT] level image data levelImages[0] is the level 0 image which has the highest resolution levelImages[N] is the level N image, it is half the size of level N-1 image

◆ dwPyramidImageProperties

struct dwPyramidImageProperties
Data Fields
uint32_t levelCount number of level images in pyramid
dwImageProperties levelProps[DW_PYRAMID_LEVEL_MAX_COUNT] level image properties levelProps[0] refers to the level 0 image which has the highest resolution levelProps[N] refers to the level N image, it is half the size of level N-1 image

◆ dwPyramidPVAParams

struct dwPyramidPVAParams
Data Fields
uint32_t imageHeight Input image height.
uint32_t imageWidth Input image width.
uint32_t numOfPyrLevels Output Number of Levels in Pyramid.
dwProcessorType processorType Indicates where the pipline should be executed.

Valid options are DW_PROCESSOR_TYPE_GPU, DW_PROCESSOR_TYPE_PVA_0, DW_PROCESSOR_TYPE_PVA_1

float32_t pyrScale Output Pyramid scale.

Macro Definition Documentation

◆ DW_PYRAMID_LEVEL_MAX_COUNT [1/2]

#define DW_PYRAMID_LEVEL_MAX_COUNT   16

Definition at line 63 of file Pyramid.h.

◆ DW_PYRAMID_LEVEL_MAX_COUNT [2/2]

#define DW_PYRAMID_LEVEL_MAX_COUNT   16

Definition at line 65 of file PyramidPVA.h.

Typedef Documentation

◆ dwPyramidPVAHandle_t

typedef struct dwPyramidPVAObject* dwPyramidPVAHandle_t

Handle to a Pyramid object.

Definition at line 70 of file PyramidPVA.h.

Function Documentation

◆ dwImageFilter_computePyramid()

DW_API_PUBLIC dwStatus dwImageFilter_computePyramid ( dwPyramidImage pyramid,
const dwImageCUDA image,
cudaStream_t  stream,
dwContextHandle_t  context 
)

Builds the pyramid from level 0 image.

Parameters
[in,out]pyramidpyramid images that will be built, must be initialized by dwPyramid_create first
[in]imageSpecifies the level 0 image which has the highest resolution
[in]streamSpecifies the CUDA stream to use during pyramid building.
[in]contextSpecifies the handle to the active DW context
Returns
DW_INVALID_ARGUMENT if pyramid, image or context are NULL
DW_INVALID_ARGUMENT if width/height of input image differs from the one in dwPyramid_create
DW_BAD_CAST if level image in pyramid has invalid types
DW_SUCCESS otherwise
Note
Before computing pyramid, dwPyramidImage must be initialized by dwPyramid_create, input image must have the same width/height as in dwPyramid_create

◆ dwPyramid_create()

DW_API_PUBLIC dwStatus dwPyramid_create ( dwPyramidImage pyramid,
uint32_t  levelCount,
uint32_t  width,
uint32_t  height,
dwTrivialDataType  pxlType,
dwContextHandle_t  context 
)

Creates and initializes an image pyramid.

Parameters
[out]pyramidA pointer to the pyramid image will be returned here.
[in]levelCountNumber of levels in the pyramid
[in]widthWidth of level 0 image
[in]heightHeight of level 0 image
[in]pxlTypeData Type of pyramid, currently only DW_TYPE_UINT8, DW_TYPE_UINT16, DW_TYPE_FLOAT16 and DW_TYPE_FLOAT32 are supported
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if pyramid or context are NULL
DW_INVALID_ARGUMENT if pxlType is unsupported
DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT
DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in dwImageFilter_buildPyramid

◆ dwPyramid_createFromProperties()

DW_API_PUBLIC dwStatus dwPyramid_createFromProperties ( dwPyramidImage pyramid,
dwPyramidImageProperties  props,
dwContextHandle_t  context 
)

Creates and initializes an image pyramid.

Parameters
[out]pyramidA pointer to the pyramid image will be returned here.
[in]propsProperties of the pyramid image
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if pyramid or context are NULL DW_INVALID_ARGUMENT if pxlType is unsupported DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT DW_SUCCESS otherwise

◆ dwPyramid_destroy()

DW_API_PUBLIC dwStatus dwPyramid_destroy ( dwPyramidImage  pyramid)

Destroy pyramid images.

Parameters
[in]pyramidpyramid image to be destroyed
Returns
DW_INVALID_ARGUMENT if level image in pyramid contains invalid data
DW_SUCCESS otherwise.

◆ dwPyramid_fillProperties()

DW_API_PUBLIC dwStatus dwPyramid_fillProperties ( dwPyramidImageProperties props,
uint32_t  levelCount,
uint32_t  width,
uint32_t  height,
dwTrivialDataType  pxlType 
)

Fills the pyramid image properties structure.

Parameters
[out]propsA pointer to properties structure to be filled.
[in]levelCountNumber of levels in the pyramid
[in]widthWidth of level 0 image
[in]heightHeight of level 0 image
[in]pxlTypeData Type of pyramid, currently only DW_TYPE_UINT8, DW_TYPE_UINT16, DW_TYPE_FLOAT16 and DW_TYPE_FLOAT32 are supported
Returns
DW_INVALID_ARGUMENT if props is NULL DW_INVALID_ARGUMENT if pxlType is unsupported DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in dwImageFilter_buildPyramid

◆ dwPyramid_getProperties()

DW_API_PUBLIC dwStatus dwPyramid_getProperties ( dwPyramidImageProperties props,
dwPyramidImage pyramid,
dwContextHandle_t  context 
)

Gets the properties of a pyramid image.

Parameters
[out]propsA pointer to properties structure to be filled.
[in]pyramidA pointer to the pyramid image
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if props or pyramid or context are NULL DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in dwImageFilter_buildPyramid

◆ dwPyramidPVA_computePyramid()

DW_API_PUBLIC dwStatus dwPyramidPVA_computePyramid ( dwPyramidImage pyramid,
const dwImageHandle_t  image,
cudaStream_t  stream,
dwPyramidPVAHandle_t  obj 
)

Builds the pyramid from level 0 image.

Parameters
[in,out]pyramidpyramid images that will be built, must be initialized by dwPyramid_create first
[in]imageSpecifies the level 0 image which has the highest resolution. Currently the supported image type is DW_IMAGE_CUDA, the supported image formats are DW_IMAGE_FORMAT_R_UINT8, DW_IMAGE_FORMAT_R_FLOAT16 and DW_IMAGE_FORMAT_R_FLOAT32.
[in]streamSpecifies the CUDA stream to use during pyramid building.
[in]objSpecifies the handle to the active Pyramid Object
Returns
DW_INVALID_ARGUMENT if pyramid, image or context are NULL DW_INVALID_ARGUMENT if width/height of input image differs from the one in dwPyramid_create DW_BAD_CAST if level image in pyramid has invalid types DW_SUCCESS otherwise.
Note
Before computing pyramid, dwPyramidImage must be initialized by dwPyramid_initialize and dwPyramid_create, input image must have the same width/height as in dwPyramid_create

◆ dwPyramidPVA_create()

DW_API_PUBLIC dwStatus dwPyramidPVA_create ( dwPyramidImage pyramid,
uint32_t  levelCount,
uint32_t  width,
uint32_t  height,
dwTrivialDataType  pxlType,
dwContextHandle_t  context 
)

Creates and initializes an image pyramid.

Parameters
[out]pyramidA pointer to the pyramid image will be returned here.
[in]levelCountNumber of levels in the pyramid
[in]widthWidth of level 0 image
[in]heightHeight of level 0 image
[in]pxlTypeData Type of pyramid, currently only DW_TYPE_UINT8, DW_TYPE_UINT16, DW_TYPE_FLOAT16 and DW_TYPE_FLOAT32 are supported
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if pyramid or context are NULL DW_INVALID_ARGUMENT if pxlType is unsupported DW_INVALID_ARGUMENT if levelCount > DW_PYRAMID_LEVEL_MAX_COUNT DW_SUCCESS otherwise
Note
Level 0 image has the highest resolution in all pyramid level images, level 0 image size should be the same as input image in dwImageFilter_buildPyramid

◆ dwPyramidPVA_destroy()

DW_API_PUBLIC dwStatus dwPyramidPVA_destroy ( dwPyramidImage pyramid)

Destroy pyramid images.

Parameters
[in]pyramidpyramid image to be destroyed
Returns
DW_INVALID_ARGUMENT if level image in pyramid contains invalid data
DW_SUCCESS otherwise.

◆ dwPyramidPVA_getCUDAStream()

DW_API_PUBLIC dwStatus dwPyramidPVA_getCUDAStream ( cudaStream_t *  stream,
dwPyramidPVAHandle_t  obj 
)

Get CUDA Stream to the used.

Parameters
[out]streamcuda stream
[in]objdyramid module object
Returns
DW_INVALID_ARGUMENT, DW_INVALID_HANDLE or DW_SUCCESS

◆ dwPyramidPVA_initDefaultParams()

DW_API_PUBLIC dwStatus dwPyramidPVA_initDefaultParams ( dwPyramidPVAParams params)

Initializes default parameters for image pyramid with default values.

Parameters
[out]paramsImage Pyramid parameters
Returns
DW_INVALID_ARGUMENT if params is NULL.
DW_SUCCESS otherwise.

◆ dwPyramidPVA_initialize()

DW_API_PUBLIC dwStatus dwPyramidPVA_initialize ( dwPyramidPVAHandle_t obj,
dwPyramidPVAParams params,
dwContextHandle_t  context 
)

Initialize parameters for image pyramid.

Parameters
[out]objA pointer to handle that is initialized with parameters
[in]paramsImage pyramid parameters
[in]contextSpecifies the handle to the context under which it is created.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwPyramidPVA_release()

DW_API_PUBLIC dwStatus dwPyramidPVA_release ( dwPyramidPVAHandle_t  obj)

Release Pyramid module.

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

◆ dwPyramidPVA_reset()

DW_API_PUBLIC dwStatus dwPyramidPVA_reset ( dwPyramidPVAHandle_t  obj)

Resets Pyramid module.

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

◆ dwPyramidPVA_setCUDAStream()

DW_API_PUBLIC dwStatus dwPyramidPVA_setCUDAStream ( cudaStream_t  stream,
dwPyramidPVAHandle_t  obj 
)

Sets CUDA Stream to the given stream.

Parameters
[in]streamcuda stream
[in]objdyramid module object
Returns
DW_INVALID_ARGUMENT, DW_INVALID_HANDLE or DW_SUCCESS