DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Image Threshold Interface

Detailed Description

Defines the Image Threshold module.

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

Data Structures

struct  dwThresholdParameters
 

Typedefs

typedef struct dwThresholdObject * dwThresholdHandle_t
 

Enumerations

enum  dwThresholdBehavior {
  DW_THRESHOLD_BEHAVIOR_BINARY = 0,
  DW_THRESHOLD_BEHAVIOR_TRUNCATE = 1,
  DW_THRESHOLD_BEHAVIOR_TO_ZERO = 2
}
 thresholding behavior based on comparison (a > b if dwThresholdParameters.inverse is false, a < b otherwise) More...
 
enum  dwThresholdMode {
  DW_THRESHOLD_MODE_SIMPLE = 0,
  DW_THRESHOLD_MODE_OTSU = 1,
  DW_THRESHOLD_MODE_PER_PIXEL = 2
}
 

Functions

DW_API_PUBLIC dwStatus dwThreshold_applyThreshold (dwImageHandle_t outputImage, const dwImageHandle_t inputImage, dwThresholdHandle_t obj)
 Runs the Threshold Handle on input image using the operations set in dwThreshold_setOperations. More...
 
DW_API_PUBLIC dwStatus dwThreshold_getCUDAStream (cudaStream_t *stream, dwThresholdHandle_t obj)
 Gets the cuda stream used by the APIs of Image Threshold. More...
 
DW_API_PUBLIC dwStatus dwThreshold_initialize (dwThresholdHandle_t *handle, dwThresholdParameters params, dwContextHandle_t context)
 Initializes a Threshold Handle. More...
 
DW_API_PUBLIC dwStatus dwThreshold_release (dwThresholdHandle_t handle)
 Releases an Threshold Handle. More...
 
DW_API_PUBLIC dwStatus dwThreshold_reset (dwThresholdHandle_t obj)
 Resets an Threshold Handle. More...
 
DW_API_PUBLIC dwStatus dwThreshold_setCUDAStream (cudaStream_t stream, dwThresholdHandle_t obj)
 Sets the cuda stream used by the APIs of Image Threshold. More...
 
DW_API_PUBLIC dwStatus dwThreshold_setThresholdParameters (dwThresholdParameters parameters, dwThresholdHandle_t obj)
 Changes the threshold parameters in runtime. More...
 

Data Structure Documentation

◆ dwThresholdParameters

struct dwThresholdParameters
Data Fields
dwThresholdBehavior behavior threshold behavior
bool inverse if false the comparison is pixel > threshold, else pixel < threshold
uint32_t manualThresholdValue manual value for MODE_SIMPLE
uint32_t maxVal maximum value
dwThresholdMode mode threshold mode
dwImageHandle_t thresholdingImage thresholding image for MODE_PER_PIXEL.

Each pixel (x,y) in this DW_IMAGEFORMAT_R_XXX image contains the thresholding value for pixel (x,y) in the input image. If this image is obtained by Gaussian Filtering with filtering window size S, the behavior is called "adaptive gaussian thresholding with window S"

Typedef Documentation

◆ dwThresholdHandle_t

typedef struct dwThresholdObject* dwThresholdHandle_t

Definition at line 59 of file Threshold.h.

Enumeration Type Documentation

◆ dwThresholdBehavior

thresholding behavior based on comparison (a > b if dwThresholdParameters.inverse is false, a < b otherwise)

Enumerator
DW_THRESHOLD_BEHAVIOR_BINARY 

if comparison between pixel and thresh yields true, pixel = maxval else 0

DW_THRESHOLD_BEHAVIOR_TRUNCATE 

if comparison between pixel and thresh yields true, pixel = thresh else pixel

DW_THRESHOLD_BEHAVIOR_TO_ZERO 

if comparison between pixel and thresh yields true, pixel = pixel else 0

Definition at line 62 of file Threshold.h.

◆ dwThresholdMode

Enumerator
DW_THRESHOLD_MODE_SIMPLE 

based on a user selected manualThresholdValue

DW_THRESHOLD_MODE_OTSU 

automatically computes the best threshold (assuming bimodal histogram, see N. Otsu, "A Threshold Selection Method from Gray-Level Histograms", IEEE Transaction on Systems and Cybernetics, 1979)

DW_THRESHOLD_MODE_PER_PIXEL 

each pixel of the input image is thresholded individually

Definition at line 71 of file Threshold.h.

Function Documentation

◆ dwThreshold_applyThreshold()

DW_API_PUBLIC dwStatus dwThreshold_applyThreshold ( dwImageHandle_t  outputImage,
const dwImageHandle_t  inputImage,
dwThresholdHandle_t  obj 
)

Runs the Threshold Handle on input image using the operations set in dwThreshold_setOperations.

Parameters
[out]outputImageA handle to the output image
[in]inputImageA handle to the input image
[in]objHandle to the Threshold Handle
Returns
DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type

◆ dwThreshold_getCUDAStream()

DW_API_PUBLIC dwStatus dwThreshold_getCUDAStream ( cudaStream_t *  stream,
dwThresholdHandle_t  obj 
)

Gets the cuda stream used by the APIs of Image Threshold.

Parameters
[out]streamCUDA stream
[in]objHandle to the Threshold Handle
Returns
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwThreshold_initialize()

DW_API_PUBLIC dwStatus dwThreshold_initialize ( dwThresholdHandle_t handle,
dwThresholdParameters  params,
dwContextHandle_t  context 
)

Initializes a Threshold Handle.

Parameters
[out]handlePointer to the Threshold Handle.
[in]paramsparameters of image Threshold.
[in]contextHandle to Driveworks
Returns
DW_INVALID_ARGUMENT if the handle is invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwThreshold_release()

DW_API_PUBLIC dwStatus dwThreshold_release ( dwThresholdHandle_t  handle)

Releases an Threshold Handle.

Parameters
[in]handlePointer to the Threshold Handle.
Returns
DW_INVALID_ARGUMENT if the handle is invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwThreshold_reset()

DW_API_PUBLIC dwStatus dwThreshold_reset ( dwThresholdHandle_t  obj)

Resets an Threshold Handle.

Parameters
[in]objPointer to the Threshold Handle.
Returns
DW_INVALID_ARGUMENT if the handle is invalid
DW_SUCCESS if the operation is successful

◆ dwThreshold_setCUDAStream()

DW_API_PUBLIC dwStatus dwThreshold_setCUDAStream ( cudaStream_t  stream,
dwThresholdHandle_t  obj 
)

Sets the cuda stream used by the APIs of Image Threshold.

Parameters
[in]streamCUDA stream
[in]objHandle to the Threshold Handle
Returns
DW_INVALID_ARGUMENT if the handle is invalid
DW_SUCCESS if the operation is successful
DW_CUDA_ERROR if the underlying cuda operation failed

◆ dwThreshold_setThresholdParameters()

DW_API_PUBLIC dwStatus dwThreshold_setThresholdParameters ( dwThresholdParameters  parameters,
dwThresholdHandle_t  obj 
)

Changes the threshold parameters in runtime.

Parameters
[in]parametersThe new parameters to set
[in]objHandle to the Threshold Handle
Returns
DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type