NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release

Detailed Description

Defines the Image Threshold module.

Data Structures

struct  dwThresholdParameters
 

Typedefs

typedef struct dwThresholdObject * dwThresholdHandle_t
 
typedef enum dwThresholdBehavior dwThresholdBehavior
 thresholding behavior based on comparison (a > b if dwThresholdParameters.inverse is false, a < b otherwise) More...
 
typedef enum dwThresholdMode dwThresholdMode
 
typedef struct dwThresholdParameters dwThresholdParameters
 

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_initialize (dwThresholdHandle_t *handle, dwThresholdParameters params, dwContextHandle_t context)
 Initializes a Threshold Handle. More...
 
DW_API_PUBLIC dwStatus dwThreshold_reset (dwThresholdHandle_t obj)
 Resets an Threshold Handle. More...
 
DW_API_PUBLIC dwStatus dwThreshold_release (dwThresholdHandle_t handle)
 Releases an Threshold Handle. More...
 
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_setThresholdParameters (dwThresholdParameters parameters, dwThresholdHandle_t obj)
 Changes the threshold parameters in runtime. 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_getCUDAStream (cudaStream_t *stream, dwThresholdHandle_t obj)
 Gets the cuda stream used by the APIs of Image Threshold. More...
 

Typedef Documentation

◆ dwThresholdBehavior

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

◆ dwThresholdHandle_t

typedef struct dwThresholdObject* dwThresholdHandle_t

Definition at line 42 of file Threshold.h.

◆ dwThresholdMode

◆ dwThresholdParameters

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 45 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 54 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
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ 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
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ 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
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ 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
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: Yes

◆ 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
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ 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
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ 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
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes