DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Threshold.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2015-2019 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
46 #ifndef DW_IMAGEPROCESSING_SEGMENTATION_THRESHOLDING_H_
47 #define DW_IMAGEPROCESSING_SEGMENTATION_THRESHOLDING_H_
48 
50 #include <dw/core/base/Types.h>
51 #include <dw/image/Image.h>
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 typedef struct dwThresholdObject* dwThresholdHandle_t;
58 
60 typedef enum dwThresholdBehavior {
68 
69 typedef enum dwThresholdMode {
77 
78 typedef struct dwThresholdParameters
79 {
85  uint32_t maxVal;
87  bool inverse;
95 
107 dwStatus dwThreshold_initialize(dwThresholdHandle_t* handle, dwThresholdParameters params,
108  dwContextHandle_t context);
109 
118 dwStatus dwThreshold_reset(dwThresholdHandle_t obj);
119 
129 dwStatus dwThreshold_release(dwThresholdHandle_t handle);
130 
143 dwStatus dwThreshold_applyThreshold(dwImageHandle_t outputImage, const dwImageHandle_t inputImage, dwThresholdHandle_t obj);
144 
157  dwThresholdHandle_t obj);
168 dwStatus dwThreshold_setCUDAStream(cudaStream_t stream, dwThresholdHandle_t obj);
169 
181 dwStatus dwThreshold_getCUDAStream(cudaStream_t* stream, dwThresholdHandle_t obj);
182 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif // DW_THRESHOLD_H_
NVIDIA DriveWorks API: Core Types
if comparison between pixel and thresh yields true, pixel = maxval else 0
Definition: Threshold.h:62
dwThresholdBehavior
thresholding behavior based on comparison (a > b if dwThresholdParameters.inverse is false...
Definition: Threshold.h:60
bool inverse
if false the comparison is pixel > threshold, else pixel < threshold
Definition: Threshold.h:87
DW_API_PUBLIC dwStatus dwThreshold_initialize(dwThresholdHandle_t *handle, dwThresholdParameters params, dwContextHandle_t context)
Initializes a Threshold Handle.
struct dwImageObject * dwImageHandle_t
Definition: Image.h:100
DW_API_PUBLIC dwStatus dwThreshold_getCUDAStream(cudaStream_t *stream, dwThresholdHandle_t obj)
Gets the cuda stream used by the APIs of Image Threshold.
uint32_t maxVal
maximum value
Definition: Threshold.h:85
DW_API_PUBLIC dwStatus dwThreshold_release(dwThresholdHandle_t handle)
Releases an Threshold Handle.
based on a user selected manualThresholdValue
Definition: Threshold.h:71
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
dwStatus
Status definition.
Definition: Status.h:180
dwThresholdMode
Definition: Threshold.h:69
dwImageHandle_t thresholdingImage
thresholding image for MODE_PER_PIXEL.
Definition: Threshold.h:93
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:79
NVIDIA DriveWorks API: Core Methods
if comparison between pixel and thresh yields true, pixel = thresh else pixel
Definition: Threshold.h:64
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)
Definition: Threshold.h:73
DW_API_PUBLIC dwStatus dwThreshold_reset(dwThresholdHandle_t obj)
Resets an Threshold Handle.
uint32_t manualThresholdValue
manual value for MODE_SIMPLE
Definition: Threshold.h:89
dwThresholdMode mode
threshold mode
Definition: Threshold.h:81
DW_API_PUBLIC dwStatus dwThreshold_setThresholdParameters(dwThresholdParameters parameters, dwThresholdHandle_t obj)
Changes the threshold parameters in runtime.
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.
#define DW_API_PUBLIC
Definition: Exports.h:54
each pixel of the input image is thresholded individually
Definition: Threshold.h:75
dwThresholdBehavior behavior
threshold behavior
Definition: Threshold.h:83
if comparison between pixel and thresh yields true, pixel = pixel else 0
Definition: Threshold.h:66
struct dwThresholdObject * dwThresholdHandle_t
Definition: Threshold.h:57
DW_API_PUBLIC dwStatus dwThreshold_setCUDAStream(cudaStream_t stream, dwThresholdHandle_t obj)
Sets the cuda stream used by the APIs of Image Threshold.