DriveWorks SDK Reference

| 0.6.67 Release

FreeSpaceDetector

Detailed Description

Defines free space detector module based on FreeSpaceNet, i.e., DNN based free space detector.

Data Structures

struct  dwFreeSpaceDetection
 Holds the defintion of a boundary in one image. More...
 

Typedefs

typedef struct dwFreeSpaceDetectorObject * dwFreeSpaceDetectorHandle_t
 Handle to a DataConditioner. More...
 

Enumerations

enum  dwFreeSpaceBoundaryType {
  DW_BOUNDARY_TYPE_OTHER = 0,
  DW_BOUNDARY_TYPE_CURB = 1,
  DW_BOUNDARY_TYPE_VEHICLE = 2,
  DW_BOUNDARY_TYPE_PERSON = 3,
  DW_BOUNDARY_TYPE_UNDEFINED = 4
}
 Category of free space boundary. More...
 

Functions

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getBoundaryDetection (dwFreeSpaceDetection *boundary, dwFreeSpaceDetectorHandle_t obj)
 Gets the latest computed results. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getCUDAStream (cudaStream_t *stream, dwFreeSpaceDetectorHandle_t obj)
 Gets CUDA stream used by the free space detection. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getDetectionROI (dwRect *roi, dwFreeSpaceDetectorHandle_t obj)
 Gets the detection Region of Interest (ROI) for the detector. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getDNNMetaData (dwDNNMetaData *metaData, dwFreeSpaceDetectorHandle_t obj)
 Returns the DNN metadata. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_initializeCalibratedFreeSpaceNet (dwFreeSpaceDetectorHandle_t *obj, uint32_t frameWidth, uint32_t frameHeight, cudaStream_t stream, dwTransformation cam2rig, float32_t maxDistance, dwCalibratedCameraHandle_t cam, dwContextHandle_t ctx)
 Initializes a free space detector module based on FreeSpaceNet with a calibrated camera. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_initializeFreeSpaceNet (dwFreeSpaceDetectorHandle_t *obj, uint32_t frameWidth, uint32_t frameHeight, cudaStream_t stream, dwContextHandle_t ctx)
 Initializes a free space detector module based on FreeSpaceNet. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_interpretHost (dwFreeSpaceDetectorHandle_t obj)
 Runs the interpretation of the processed results on the CPU. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_processDeviceAsync (const dwImageCUDA *frame, dwFreeSpaceDetectorHandle_t obj)
 Processes the given frame on the GPU asynchronously. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_release (dwFreeSpaceDetectorHandle_t *obj)
 Releases the detector module. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_reset (dwFreeSpaceDetectorHandle_t obj)
 Resets the free space detector module. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setCUDAStream (cudaStream_t stream, dwFreeSpaceDetectorHandle_t obj)
 Sets the CUDA stream for CUDA related operations. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setDetectionROI (const dwRect *roi, dwFreeSpaceDetectorHandle_t obj)
 Sets the detection Region of Interest (ROI) for the detector. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setSpatialSmoothFilterWidth (uint32_t width, dwFreeSpaceDetectorHandle_t obj)
 Sets the spatial smoothing filter width. More...
 
DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setTemporalSmoothFactor (float32_t factor, dwFreeSpaceDetectorHandle_t obj)
 Sets the temporal smoothing factor. More...
 

Data Structure Documentation

◆ dwFreeSpaceDetection

struct dwFreeSpaceDetection
Data Fields
const dwVector2f * boundaryImagePoint Boundary point location in image space (pixels).
const dwFreeSpaceBoundaryType * boundaryType Category of the boundary.
const dwVector2f * boundaryWorldPoint Boundary point location in car domain (meter).
uint32_t numberOfBoundaryPoints

Typedef Documentation

◆ dwFreeSpaceDetectorHandle_t

typedef struct dwFreeSpaceDetectorObject* dwFreeSpaceDetectorHandle_t

Handle to a DataConditioner.

Definition at line 91 of file FreeSpaceDetector.h.

Enumeration Type Documentation

◆ dwFreeSpaceBoundaryType

Category of free space boundary.

Enumerator
DW_BOUNDARY_TYPE_OTHER 

boundary with other objects

DW_BOUNDARY_TYPE_CURB 

boundary with curb

DW_BOUNDARY_TYPE_VEHICLE 

boundary with vehicle

DW_BOUNDARY_TYPE_PERSON 

boundary with person

DW_BOUNDARY_TYPE_UNDEFINED 

undefined boundary

Definition at line 64 of file FreeSpaceDetector.h.

Function Documentation

◆ dwFreeSpaceDetector_getBoundaryDetection()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getBoundaryDetection ( dwFreeSpaceDetection boundary,
dwFreeSpaceDetectorHandle_t  obj 
)

Gets the latest computed results.

This method has to be executed after dwFreeSpaceDetector_interpretHost() to get the current output of the detector.

Note
The dwFreeSpaceDetection component pointers are only valid till the next proccesDeviceAsync method
Parameters
[out]boundaryA user pointer to be filled with information about detected boundary points.
[in]objA free space detector handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_getCUDAStream()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getCUDAStream ( cudaStream_t *  stream,
dwFreeSpaceDetectorHandle_t  obj 
)

Gets CUDA stream used by the free space detection.

Parameters
[out]streamThe CUDA stream currently used.
[in]objA handle to the free space detection module.
Returns
DW_INVALID_HANDLE if the given context handle is invalid,
or DW_SUCCESS otherwise.

◆ dwFreeSpaceDetector_getDetectionROI()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getDetectionROI ( dwRect roi,
dwFreeSpaceDetectorHandle_t  obj 
)

Gets the detection Region of Interest (ROI) for the detector.

Parameters
[out]roiROI of frame to be processed by the detector, default to full frame
[in]objA free space detector handle
Returns
dwRect&

◆ dwFreeSpaceDetector_getDNNMetaData()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_getDNNMetaData ( dwDNNMetaData metaData,
dwFreeSpaceDetectorHandle_t  obj 
)

Returns the DNN metadata.

Parameters
[out]metaDataPointer to metaData struct.
[in]objSpecifies the FreeSpace handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwFreeSpaceDetector_initializeCalibratedFreeSpaceNet()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_initializeCalibratedFreeSpaceNet ( dwFreeSpaceDetectorHandle_t obj,
uint32_t  frameWidth,
uint32_t  frameHeight,
cudaStream_t  stream,
dwTransformation  cam2rig,
float32_t  maxDistance,
dwCalibratedCameraHandle_t  cam,
dwContextHandle_t  ctx 
)

Initializes a free space detector module based on FreeSpaceNet with a calibrated camera.

Calibrated camera is used to estimate boundary points in car space.

Parameters
[out]objA pointer to the free space detector handle for the created module.
[in]frameWidthWidth of camera frames to apply free space detector later.
[in]frameHeightHeight of camera frames to apply free space detector later.
[in]streamCUDA stream on which to perform all operations.
[in]cam2rigSpecifies the transformation from camera to rig.
[in]maxDistanceMaximum distance in meters at which free space boundary should be detected.
[in]camSpecifies the handle to the calibrated front looking camera.
[in]ctxSpecifies the handler to the context to create FreeSpaceNet.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS
Note
Extrinsic parameters of the camera must take rig as the origin of World Coordinate System.

◆ dwFreeSpaceDetector_initializeFreeSpaceNet()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_initializeFreeSpaceNet ( dwFreeSpaceDetectorHandle_t obj,
uint32_t  frameWidth,
uint32_t  frameHeight,
cudaStream_t  stream,
dwContextHandle_t  ctx 
)

Initializes a free space detector module based on FreeSpaceNet.

By default it runs on stream 0

Parameters
[out]objA pointer to the free space detector handle for the created module.
[in]frameWidthWidth of camera frames to apply free space detector later.
[in]frameHeightHeight of camera frames to apply free space detector later.
[in]streamCUDA stream on which to perform all operations.
[in]ctxSpecifies the handler to the context to create FreeSpaceNet.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwFreeSpaceDetector_interpretHost()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_interpretHost ( dwFreeSpaceDetectorHandle_t  obj)

Runs the interpretation of the processed results on the CPU.

This method has to be executed after dwFreeSpaceDetector_processDeviceAsync() to get the actual output of the detector.

Parameters
[in]objA free space detector handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_processDeviceAsync()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_processDeviceAsync ( const dwImageCUDA frame,
dwFreeSpaceDetectorHandle_t  obj 
)

Processes the given frame on the GPU asynchronously.

Parameters
[in]frameCUDA frame to be processed for detection.
[in]objA free space detector handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_release()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_release ( dwFreeSpaceDetectorHandle_t obj)

Releases the detector module.

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

◆ dwFreeSpaceDetector_reset()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_reset ( dwFreeSpaceDetectorHandle_t  obj)

Resets the free space detector module.

Parameters
[in]objSpecifies the detector to reset.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_setCUDAStream()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setCUDAStream ( cudaStream_t  stream,
dwFreeSpaceDetectorHandle_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 initialization.
[in]objA handle to the free space detector module for which to set CUDA stream.
Returns
DW_INVALID_HANDLE if the given context handle is invalid,
or DW_SUCCESS otherwise.

◆ dwFreeSpaceDetector_setDetectionROI()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setDetectionROI ( const dwRect roi,
dwFreeSpaceDetectorHandle_t  obj 
)

Sets the detection Region of Interest (ROI) for the detector.

Parameters
[in]roiROI of frame to be processed by the detector, default to full frame.
[in]objA free space detector handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_setSpatialSmoothFilterWidth()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setSpatialSmoothFilterWidth ( uint32_t  width,
dwFreeSpaceDetectorHandle_t  obj 
)

Sets the spatial smoothing filter width.

Note
Filter width must be an odd integer within (1, numberOfBoundaryPoints/10). The boundary of the 1-D Gaussian filter is set to 2.5* standard deviation.
Parameters
[in]widthWidth of an 1-D Gaussian filter used to spatially smooth the boundary points. Default to 1 and no spatial smoothing.
[in]objA free space detector handle (must be of type FreeSpaceNet).
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwFreeSpaceDetector_setTemporalSmoothFactor()

DW_API_PUBLIC dwStatus dwFreeSpaceDetector_setTemporalSmoothFactor ( float32_t  factor,
dwFreeSpaceDetectorHandle_t  obj 
)

Sets the temporal smoothing factor.

Parameters
[in]factorAverage previous and current free space boundary points.
smoothed point = factor*previous point + (1.0-factor)*current point
To turn off temporal smoothing, set factor to zero (0).
[in]objA free space detector handle (must be of type FreeSpaceNet).
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST