DriveWorks SDK Reference

| 0.6.67 Release

DataConditioner.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-2017 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 
45 #ifndef DW_DATACONDITIONER_H__
46 #define DW_DATACONDITIONER_H__
47 
48 #include <dw/core/Context.h>
49 #include <dw/core/Types.h>
50 #include <dw/image/Image.h>
51 #include <dw/dnn/DNNTypes.h>
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 typedef struct dwDataConditionerParams {
74 
78 typedef struct dwDataConditionerObject *dwDataConditionerHandle_t;
79 
90 
108 dwStatus dwDataConditioner_initialize(dwDataConditionerHandle_t *obj,
109  const dwBlobSize *networkInputBlobSize,
110  const dwDataConditionerParams *dataConditionerParams,
111  cudaStream_t stream, dwContextHandle_t ctx);
112 
125 dwStatus dwDataConditioner_setCUDAStream(cudaStream_t stream, dwDataConditionerHandle_t obj);
126 
137 dwStatus dwDataConditioner_getCUDAStream(cudaStream_t *stream, dwDataConditionerHandle_t obj);
138 
148 dwStatus dwDataConditioner_reset(dwDataConditionerHandle_t obj);
149 
161 dwStatus dwDataConditioner_release(dwDataConditionerHandle_t *obj);
162 
190 dwStatus dwDataConditioner_prepareData(float32_t *d_outputImage, const dwImageCUDA * const *inputImages,
191  uint32_t numImages, const dwRect *roi,
192  cudaTextureAddressMode addressMode, dwDataConditionerHandle_t obj);
193 
205  dwDataConditionerHandle_t obj);
206 
222  float32_t inputX, float32_t inputY, const dwRect *roi,
223  dwDataConditionerHandle_t obj);
224 #ifdef __cplusplus
225 }
226 #endif
227 
228 #endif // DW_DATACONDITIONER_H__
DW_API_PUBLIC dwStatus dwDataConditioner_setCUDAStream(cudaStream_t stream, dwDataConditionerHandle_t obj)
Sets the CUDA stream for CUDA related operations.
DW_API_PUBLIC dwStatus dwDataConditioner_release(dwDataConditionerHandle_t *obj)
Releases the DataConditioner module.
dwBool doPerPlaneMeanNormalization
Boolean indicating whether to perform per-plane mean normalization. Default false.
const dwImageCUDA * meanImage
Mean image to be subtracted.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:77
Defines a rectangle.
Definition: Types.h:151
#define DW_MAX_IMAGE_PLANES
Definition: Image.h:80
struct dwDataConditionerObject * dwDataConditionerHandle_t
Handle to a DataConditioner.
NVIDIA DriveWorks API: DNN Data types
Defines a CUDA image.
Definition: Image.h:263
DW_API_PUBLIC dwStatus dwDataConditioner_prepareData(float32_t *d_outputImage, const dwImageCUDA *const *inputImages, uint32_t numImages, const dwRect *roi, cudaTextureAddressMode addressMode, dwDataConditionerHandle_t obj)
Runs the configured transformations on an image.
NVIDIA DriveWorks API: Core Methods
Holds blob dimensions.
Definition: DNNTypes.h:57
dwBool splitPlanes
Boolean indicating whether planes should be split. Default is true.
DW_API_PUBLIC dwStatus dwDataConditioner_initialize(dwDataConditionerHandle_t *obj, const dwBlobSize *networkInputBlobSize, const dwDataConditionerParams *dataConditionerParams, cudaStream_t stream, dwContextHandle_t ctx)
Initializes a DataConditioner module.
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
dwStatus
Status definition.
Definition: Status.h:167
DW_API_PUBLIC dwStatus dwDataConditioner_outputPositionToInput(float32_t *outputX, float32_t *outputY, float32_t inputX, float32_t inputY, const dwRect *roi, dwDataConditionerHandle_t obj)
Computes the position of a point from the interpreted DNN output on the input image.
DW_API_PUBLIC dwStatus dwDataConditioner_getOutputSize(dwBlobSize *outputBlobSize, dwDataConditionerHandle_t obj)
Computes the output size based on the input size and the operations that have been added...
enum cudaTextureAddressMode cudaTextureAddressMode
Definition: Context.h:57
float32_t meanValue[DW_MAX_IMAGE_PLANES]
Mean value to be subtracted. Default is 0.
float32_t scaleCoefficient
Scale pixel intensities. Default is 1.0.
uint8_t dwBool
Definition: Types.h:79
dwBool ignoreAspectRatio
Boolean indicating whether the aspect ratio of the input image should be kept (false) or the image sh...
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
DW_API_PUBLIC dwStatus dwDataConditioner_reset(dwDataConditionerHandle_t obj)
Resets the DataConditioner module.
DW_API_PUBLIC dwStatus dwDataConditioner_initParams(dwDataConditionerParams *dataConditionerParams)
Initializes DataConditioner parameters with default values.
#define DW_API_PUBLIC
Definition: Exports.h:76
DW_API_PUBLIC dwStatus dwDataConditioner_getCUDAStream(cudaStream_t *stream, dwDataConditionerHandle_t obj)
Gets the CUDA stream used by the data conditioner.