DriveWorks SDK Reference
3.5.78 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 
48 #ifndef DW_IMAGEPROCESSING_SEGMENTATION_THRESHOLDING_H_
49 #define DW_IMAGEPROCESSING_SEGMENTATION_THRESHOLDING_H_
50 
51 #include <dw/core/Context.h>
52 #include <dw/core/Types.h>
53 #include <dw/image/Image.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 typedef struct dwThresholdObject* dwThresholdHandle_t;
60 
62 typedef enum dwThresholdBehavior {
70 
71 typedef enum dwThresholdMode {
79 
80 typedef struct dwThresholdParameters
81 {
87  uint32_t maxVal;
89  bool inverse;
97 
109 dwStatus dwThreshold_initialize(dwThresholdHandle_t* handle, dwThresholdParameters params,
110  dwContextHandle_t context);
111 
120 dwStatus dwThreshold_reset(dwThresholdHandle_t obj);
121 
131 dwStatus dwThreshold_release(dwThresholdHandle_t handle);
132 
145 dwStatus dwThreshold_applyThreshold(dwImageHandle_t outputImage, const dwImageHandle_t inputImage, dwThresholdHandle_t obj);
146 
159  dwThresholdHandle_t obj);
170 dwStatus dwThreshold_setCUDAStream(cudaStream_t stream, dwThresholdHandle_t obj);
171 
183 dwStatus dwThreshold_getCUDAStream(cudaStream_t* stream, dwThresholdHandle_t obj);
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif // DW_THRESHOLD_H_
if comparison between pixel and thresh yields true, pixel = maxval else 0
Definition: Threshold.h:64
dwThresholdBehavior
thresholding behavior based on comparison (a > b if dwThresholdParameters.inverse is false...
Definition: Threshold.h:62
bool inverse
if false the comparison is pixel > threshold, else pixel < threshold
Definition: Threshold.h:89
NVIDIA DriveWorks API: Core Types
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:99
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:87
DW_API_PUBLIC dwStatus dwThreshold_release(dwThresholdHandle_t handle)
Releases an Threshold Handle.
NVIDIA DriveWorks API: Core Methods
based on a user selected manualThresholdValue
Definition: Threshold.h:73
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
dwStatus
Status definition.
Definition: Status.h:178
dwThresholdMode
Definition: Threshold.h:71
dwImageHandle_t thresholdingImage
thresholding image for MODE_PER_PIXEL.
Definition: Threshold.h:95
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
if comparison between pixel and thresh yields true, pixel = thresh else pixel
Definition: Threshold.h:66
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:75
DW_API_PUBLIC dwStatus dwThreshold_reset(dwThresholdHandle_t obj)
Resets an Threshold Handle.
uint32_t manualThresholdValue
manual value for MODE_SIMPLE
Definition: Threshold.h:91
dwThresholdMode mode
threshold mode
Definition: Threshold.h:83
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:56
each pixel of the input image is thresholded individually
Definition: Threshold.h:77
dwThresholdBehavior behavior
threshold behavior
Definition: Threshold.h:85
if comparison between pixel and thresh yields true, pixel = pixel else 0
Definition: Threshold.h:68
struct dwThresholdObject * dwThresholdHandle_t
Definition: Threshold.h:59
DW_API_PUBLIC dwStatus dwThreshold_setCUDAStream(cudaStream_t stream, dwThresholdHandle_t obj)
Sets the cuda stream used by the APIs of Image Threshold.