Defines free space detector module based on OpenRoadNet, i.e., DNN based free space detector.
Data Structures | |
struct | dwFreespaceDetection |
Holds the definition of free space boundary in one image. More... | |
struct | dwFreespaceDetectorInitParams |
Holds the common free space detector initialization parameters. More... | |
struct | dwFreespaceDetectorRuntimeParams |
Holds the free space detector runtime parameters. More... | |
Macros | |
#define | DW_FREESPACE_IMAGE_MAX_COUNT 6 |
Maximum number of images to run free space detector on. More... | |
#define | DW_FREESPACE_POINT_MAX_COUNT 960 |
Typedefs | |
typedef struct dwFreespaceDetectorObject * | dwFreespaceDetectorHandle_t |
Handle to a free space detector. More... | |
Enumerations | |
enum | dwFreespaceDetectorStage { DW_FREESPACE_DETECTOR_STAGE_GPU_ASYNC_PREPROCESSING = 0, DW_FREESPACE_DETECTOR_STAGE_GPU_ASYNC_INFERENCE = 1, DW_FREESPACE_DETECTOR_STAGE_CPU_POSTPROCESSING = 2, DW_FREESPACE_DETECTOR_STAGE_COUNT = 3 } |
Defines the processing stages of a free space detector. More... | |
struct dwFreespaceDetection |
Data Fields | ||
---|---|---|
dwVector2f | boundaryImagePoint[DW_FREESPACE_POINT_MAX_COUNT] | Boundary point location in image space (pixels). |
dwFreespaceBoundaryType | boundaryType[DW_FREESPACE_POINT_MAX_COUNT] | Category of the boundary. |
dwVector2f | boundaryWorldPoint[DW_FREESPACE_POINT_MAX_COUNT] | Boundary point location in car domain (meter). |
uint32_t | numberOfBoundaryPoints |
struct dwFreespaceDetectorInitParams |
Data Fields | ||
---|---|---|
dwCameraModelHandle_t | cam | Specifies the handle to the calibrated camera. Set to DW_NULL_HANDLE to get image space output only. |
dwCameraModelHandle_t | cam_new[DW_FREESPACE_IMAGE_MAX_COUNT] | Camera intrinsics of batched frames. Set to DW_NULL_HANDLE to get image space output only. |
uint32_t | frameHeight | Height of camera frame when initialized without camera intrinsics, ignored if camera handle is valid. |
uint32_t | frameWidth | Width of camera frame when initialized without camera intrinsics, ignored if camera handle is valid. |
float32_t | maxDistance[DW_FREESPACE_IMAGE_MAX_COUNT] |
Maximum valid distances in meters of the batched frames. Projected freespace boundary distance beyond maxDistance will be truncated. Note that maxDistances are effective only if proper camera intrinsics and extrisics were setup. |
uint32_t | maxNumImages | Maximum number of images (cannot be larger than DW_FREESPACE_IMAGE_MAX_COUNT). Default is 1. |
dwOpenRoadNetHandle_t | openroadnet | Specifies the handle to the OpenRoadNet module. |
dwRect | roi[DW_FREESPACE_IMAGE_MAX_COUNT] | Region Of Interest of batched frames to be processed by the detector. |
cudaStream_t | stream | CUDA stream on which to perform all operations. |
struct dwFreespaceDetectorRuntimeParams |
Data Fields | ||
---|---|---|
float32_t | maxDistance | Maximum distance in meters at which free space boundary distance can be distinguished. |
dwRect | roi | Region Of Interest of frame to be processed by the detector. |
uint32_t | spatialSmoothingWidth | Width of an 1-D Gaussian filter, check dwFreespaceDetector_setSpatialSmoothFilterWidth for more details. |
float32_t | temporalSmoothingFactor | Temporal smooth factor, check dwFreespaceDetector_setTemporalSmoothFactor for more details. |
#define DW_FREESPACE_IMAGE_MAX_COUNT 6 |
Maximum number of images to run free space detector on.
Definition at line 64 of file FreespaceDetector.h.
#define DW_FREESPACE_POINT_MAX_COUNT 960 |
Definition at line 65 of file FreespaceDetector.h.
typedef struct dwFreespaceDetectorObject* dwFreespaceDetectorHandle_t |
Handle to a free space detector.
Definition at line 142 of file FreespaceDetector.h.
Defines the processing stages of a free space detector.
Enumerator | |
---|---|
DW_FREESPACE_DETECTOR_STAGE_GPU_ASYNC_PREPROCESSING | |
DW_FREESPACE_DETECTOR_STAGE_GPU_ASYNC_INFERENCE | |
DW_FREESPACE_DETECTOR_STAGE_CPU_POSTPROCESSING | |
DW_FREESPACE_DETECTOR_STAGE_COUNT |
Definition at line 58 of file FreespaceDetector_processPipeline.h.
DW_API_PUBLIC dwStatus dwFreespaceDetector_bindInput | ( | const dwImageCUDA *const * | frames, |
uint32_t | frameCount, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Binds the input to the detector as a list of images.
[in] | frames | Array storing pointers to frames where the detector is to be applied. |
[in] | frameCount | Number of frames provided in the array. |
[in] | obj | Specifies the FreespaceDetector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_bindOutput | ( | dwFreespaceDetection * | boundary, |
uint32_t | frameIdx, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Bind the ouput of the free space detector.
[in] | boundary | Pointer to free space boundary output array structure. |
[in] | frameIdx | The frame index corresponds to the boundary to be bound. |
[in] | obj | Specifies the FreespaceDetector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_detectBoundary | ( | dwFreespaceDetection * | boundary, |
const dwImageCUDA * | frame, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Processes the given frame on the GPU asynchronously, runs the interpretation of the processed results on the CPU, and gets the latest computed results.
[out] | boundary | A user pointer to be filled with information about detected boundary points. |
[in] | frame | CUDA frame to be processed for detection. |
[in] | obj | A free space detector handle. |
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.
[out] | boundary | A user pointer to be filled with information about detected boundary points. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_getCUDAStream | ( | cudaStream_t * | stream, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Gets CUDA stream used by the free space detection.
[out] | stream | The CUDA stream currently used. |
[in] | obj | A handle to the free space detection module. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDetectionROI | ( | dwRect * | roi, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Gets the detection Region of Interest (ROI) for the detector.
[out] | roi | ROI of frame to be processed by the detector, default to full frame |
[in] | obj | A free space detector handle |
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDetectionROI_new | ( | uint32_t | imageIdx, |
dwRect * | roi, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Gets the detection Region of Interest (ROI) for the detector.
[in] | imageIdx | The index of camera image in the batch. |
[out] | roi | ROI of frame to be processed by the detector, default to full frame |
[in] | obj | A free space detector handle |
DW_API_PUBLIC dwStatus dwFreespaceDetector_getDNNMetaData | ( | dwDNNMetaData * | metaData, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Returns the DNN metadata.
[out] | metaData | Pointer to metaData struct. |
[in] | obj | Specifies the Freespace handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_getRuntimeParams | ( | dwFreespaceDetectorRuntimeParams * | rtParams, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Get the runtime parameters associated with a free space detector module.
[in] | rtParams | Runtime parameters to be retrieved from a free space detector module. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_initializeFromOpenRoadNet | ( | dwFreespaceDetectorHandle_t * | obj, |
dwOpenRoadNetHandle_t | openroadnet, | ||
uint32_t | frameWidth, | ||
uint32_t | frameHeight, | ||
cudaStream_t | stream, | ||
dwContextHandle_t | ctx | ||
) |
Initializes a free space detector module based on OpenRoadNet.
[out] | obj | A pointer to the free space detector handle for the created module. |
[in] | openroadnet | Specifies the handle to the OpenRoadNet module. |
[in] | frameWidth | Width of camera frames to apply free space detector later. |
[in] | frameHeight | Height of camera frames to apply free space detector later. |
[in] | stream | CUDA stream on which to perform all operations. |
[in] | ctx | Specifies the handler to the context to create OpenRoadNet. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_initializeFromOpenRoadNet_new | ( | dwFreespaceDetectorHandle_t * | obj, |
const dwFreespaceDetectorInitParams * | initParams, | ||
dwContextHandle_t | ctx | ||
) |
Initializes a free space detector module based on OpenRoadNet.
[out] | obj | A pointer to the free space detector handle for the created module. |
[in] | initParams | Parameters required to initialize a free space detector module. |
[in] | ctx | Specifies the handler to the context to create OpenRoadNet. |
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.
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_process | ( | dwFreespaceDetectorStage | stage, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Process the bound input frame array and store the result to where pointed by bound output array.
[in] | stage | the processing stage to be executed. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_processDeviceAsync | ( | const dwImageCUDA * | frame, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Processes the given frame on the GPU asynchronously.
[in] | frame | CUDA frame to be processed for detection. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_release | ( | dwFreespaceDetectorHandle_t | obj | ) |
Releases the detector module.
[in] | obj | The object handle to release. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_reset | ( | dwFreespaceDetectorHandle_t | obj | ) |
Resets the free space detector module.
[in] | obj | Specifies the detector to reset. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraExtrinsics | ( | dwTransformation3f | cam2rig, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the transformation from camera to rig.
[in] | cam2rig | Specifies the transformation from camera to rig. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraExtrinsics_new | ( | uint32_t | imageIdx, |
dwTransformation3f | cam2rig, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the camera to rig transformation for a specific camera image in the batch.
[in] | imageIdx | The index of camera image in the batch. |
[in] | cam2rig | Specifies the transformation from camera to rig. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCameraHandle | ( | dwCameraModelHandle_t | cam, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the handle to the calibrated camera.
[in] | cam | Specifies the handle to the calibrated front looking camera. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setCUDAStream | ( | cudaStream_t | stream, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Sets the CUDA stream for CUDA related operations.
[in] | stream | The CUDA stream to be used. Default is the one passed during initialization. |
[in] | obj | A handle to the free space detector module for which to set CUDA stream. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setDetectionROI | ( | const dwRect * | roi, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the detection Region of Interest (ROI) for the detector.
[in] | roi | ROI of frame to be processed by the detector, default to full frame. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setDetectionROI_new | ( | uint32_t | imageIdx, |
const dwRect * | roi, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the detection Region of Interest (ROI) for the detector.
[in] | imageIdx | The index of camera image in the batch. |
[in] | roi | ROI of frame to be processed by the detector, default to full frame. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setMaxFreespaceDistance | ( | float32_t | maxDistance, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the maximum distance in meters at which free space boundary can be detected.
[in] | maxDistance | Maximum distance in meters at which free space boundary distance can be distinguished. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setMaxFreespaceDistance_new | ( | uint32_t | imageIdx, |
float32_t | maxDistance, | ||
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the maximum distance in meters free space boundary can be detected for a specific camera image in the batch.
[in] | imageIdx | The index of camera image in the batch. |
[in] | maxDistance | Maximum distance in meters at which free space boundary distance can be distinguished. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setRuntimeParams | ( | const dwFreespaceDetectorRuntimeParams * | rtParams, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the runtime parameters associated with a free space detector module.
[in] | rtParams | Runtime parameters associated with a free space detector module. |
[in] | obj | A free space detector handle. |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setSpatialSmoothFilterWidth | ( | uint32_t | width, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Sets the spatial smoothing filter width.
[in] | width | Width of an 1-D Gaussian filter used to spatially smooth the boundary points. Default to 1 and no spatial smoothing. |
[in] | obj | A free space detector handle (must be of type OpenRoadNet). |
DW_API_PUBLIC dwStatus dwFreespaceDetector_setTemporalSmoothFactor | ( | float32_t | factor, |
dwFreespaceDetectorHandle_t | obj | ||
) |
Set the temporal smoothing factor.
[in] | factor | Average previous and current free space boundary points. smoothed point = factor*previous point + (1.0-factor)*current point |
[in] | obj | A free space detector handle (must be of type OpenRoadNet). |