DriveWorks SDK Reference
5.4.5418 Release
For Test and Development only

Threshold.h
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2015-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is 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:105
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.