DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

SFM.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_SFM_SFM_H_
49 #define DW_IMAGEPROCESSING_SFM_SFM_H_
50 
51 #include <dw/core/Config.h>
52 #include <dw/rig/Rig.h>
54 #include <dw/core/Exports.h>
55 #include <dw/core/Context.h>
56 #include <dw/core/Types.h>
57 
59 
60 #include <cuda_runtime_api.h>
61 
62 #include <stdint.h>
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
75 // dwReconstructor
77 
81 typedef struct dwReconstructorObject* dwReconstructorHandle_t;
82 
84 typedef struct dwReconstructorObject const* dwConstReconstructorHandle_t;
85 
89 typedef struct dwReconstructorConfig
90 {
93 
95  uint32_t maxFeatureCount;
96 
99 
103 
107 
110 
115 
121 
131 
146 dwStatus dwReconstructor_initialize(dwReconstructorHandle_t* obj,
147  const dwReconstructorConfig* config,
148  cudaStream_t stream,
149  dwContextHandle_t context);
150 
161 dwStatus dwReconstructor_reset(dwReconstructorHandle_t obj);
162 
177 dwStatus dwReconstructor_release(dwReconstructorHandle_t obj);
178 
196 dwStatus dwReconstructor_enableCamerasForPoseEstimation(const uint8_t enabled[], dwReconstructorHandle_t obj);
197 
227  const dwTransformation3f* predictedRig2World,
228  const uint32_t listCount,
229  const uint32_t* const d_featureCounts[],
230  const dwFeature2DStatus* const d_statuses[],
231  const dwVector2f* const d_trackedLocations[],
232  const dwVector4f* const d_worldPoints[],
233  dwReconstructorHandle_t obj);
234 
250  dwReconstructorHandle_t obj);
251 
277 dwStatus dwReconstructor_updateHistory(int32_t* rig2WorldHistoryIdx,
278  const dwTransformation3f* rig2World,
279  const uint32_t listCount,
280  const uint32_t* const d_featureCounts[],
281  const dwVector2f* const d_trackedLocations[],
282  dwReconstructorHandle_t obj);
283 
305  dwFeature2DStatus* d_statuses,
306  const uint32_t* d_featureCount,
307  const uint32_t cameraIdx,
308  dwReconstructorHandle_t obj);
309 
323  const dwTransformation3f* rig2World,
324  const uint32_t* const d_pointCount[],
325  const dwVector4f* const d_worldPoints[],
326  dwReconstructorHandle_t obj);
327 
349  uint32_t cameraIdx,
350  const dwTransformation3f* previousRigToWorld,
351  const dwTransformation3f* predictedRigToWorld,
352  const uint32_t* d_featureCount,
353  const dwFeature2DStatus d_featureStatuses[],
354  const dwVector2f d_featureLocations[],
355  const dwVector4f d_worldPoints[],
356  dwReconstructorHandle_t obj);
357 
373 dwStatus dwReconstructor_compactFeatureHistory(const uint32_t cameraIdx,
374  const uint32_t* d_validIndexCount,
375  const uint32_t* d_newToOldMap,
376  dwReconstructorHandle_t obj);
377 
393  const uint32_t* d_validIndexCount,
394  const uint32_t* d_newToOldMap,
395  dwReconstructorHandle_t obj);
396 
409 dwStatus dwReconstructor_setCUDAStream(cudaStream_t stream, dwReconstructorHandle_t obj);
410 
421 dwStatus dwReconstructor_getCUDAStream(cudaStream_t* stream, dwReconstructorHandle_t obj);
422 
423 #ifdef __cplusplus
424 }
425 #endif
426 
429 #endif // DW_IMAGEPROCESSING_SFM_SFM_H_
NVIDIA DriveWorks API: Camera Methods
DW_API_PUBLIC dwStatus dwReconstructor_compactFeatureHistory(const uint32_t cameraIdx, const uint32_t *d_validIndexCount, const uint32_t *d_newToOldMap, dwReconstructorHandle_t obj)
Compacts the internal feature history by keeping only selected features.
DW_API_PUBLIC dwStatus dwReconstructor_updateHistory(int32_t *rig2WorldHistoryIdx, const dwTransformation3f *rig2World, const uint32_t listCount, const uint32_t *const d_featureCounts[], const dwVector2f *const d_trackedLocations[], dwReconstructorHandle_t obj)
Updates the feature and pose history.
NVIDIA DriveWorks API: Core Types
float32_t minNewObservationAngleRad
Specifies the minimum cosine of the angle between two optical rays to add a new one to the feature hi...
Definition: SFM.h:102
float float32_t
Specifies POD types.
Definition: Types.h:70
NVIDIA DriveWorks API: Rig Configuration
Defines a four-element single-precision floating point vector.
Definition: Types.h:335
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
uint32_t maxPoseHistoryLength
Specifies the maximum size of the history.
Definition: SFM.h:98
Configuration parameters for a reconstructor.
Definition: SFM.h:89
float32_t poseEstimationOutlierThresholdRad
Specifies the max angle of the reprojection error (angle between tracked optical ray and triangulated...
Definition: SFM.h:119
DW_API_PUBLIC dwStatus dwReconstructor_getEstimatedPose(dwTransformation3f *correctedRig2World, dwReconstructorHandle_t obj)
Returns the estimated pose from a previous call to dwReconstructor_estimatePoseAsync.
DW_API_PUBLIC dwStatus dwReconstructor_initConfig(dwReconstructorConfig *config)
Initializes the reconstructor config with default values.
uint32_t maxFeatureCount
Specifies the maximum number of features for each camera.
Definition: SFM.h:95
NVIDIA DriveWorks API: Core Methods
float32_t maxReprojectionErrorAngleRad
Specifies the max angle of the reprojection error (angle between tracked optical ray and triangulated...
Definition: SFM.h:114
DW_API_PUBLIC dwStatus dwReconstructor_enableCamerasForPoseEstimation(const uint8_t enabled[], dwReconstructorHandle_t obj)
Marks the cameras to use for pose estimation.
DW_API_PUBLIC dwStatus dwReconstructor_initialize(dwReconstructorHandle_t *obj, const dwReconstructorConfig *config, cudaStream_t stream, dwContextHandle_t context)
Creates and initializes a reconstructor.
Specifies a 3D rigid transformation.
Definition: Types.h:462
DW_API_PUBLIC dwStatus dwReconstructor_predictFeaturePosition(dwVector2f d_predictedLocations[], uint32_t cameraIdx, const dwTransformation3f *previousRigToWorld, const dwTransformation3f *predictedRigToWorld, const uint32_t *d_featureCount, const dwFeature2DStatus d_featureStatuses[], const dwVector2f d_featureLocations[], const dwVector4f d_worldPoints[], dwReconstructorHandle_t obj)
Predicts the positions of features based on the predicted car motion.
dwStatus
Status definition.
Definition: Status.h:178
float32_t minRigDistance
Specifies the minimum distance between vehicle poses to add a new one to the list.
Definition: SFM.h:106
uint8_t minTriangulationEntries
Specifies the minimum number of entries in the feature history needed for triangulation.
Definition: SFM.h:109
DW_API_PUBLIC dwStatus dwReconstructor_getCUDAStream(cudaStream_t *stream, dwReconstructorHandle_t obj)
Gets CUDA stream used by the reconstructor.
struct dwReconstructorObject const * dwConstReconstructorHandle_t
Handle representing a const reconstructor object.
Definition: SFM.h:84
DW_API_PUBLIC dwStatus dwReconstructor_triangulateFeatures(dwVector4f *d_worldPoints, dwFeature2DStatus *d_statuses, const uint32_t *d_featureCount, const uint32_t cameraIdx, dwReconstructorHandle_t obj)
Triangulates the features of a camera from the internal feature and pose history. ...
struct dwRigObject const * dwConstRigHandle_t
Definition: Rig.h:73
dwFeature2DStatus
Defines the possible status of a feature.
Definition: FeatureList.h:64
DW_API_PUBLIC dwStatus dwReconstructor_setCUDAStream(cudaStream_t stream, dwReconstructorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
DW_API_PUBLIC dwStatus dwReconstructor_release(dwReconstructorHandle_t obj)
Releases a reconstructor.
DW_API_PUBLIC dwStatus dwReconstructor_compactWorldPoints(dwVector4f *d_worldPoints, const uint32_t *d_validIndexCount, const uint32_t *d_newToOldMap, dwReconstructorHandle_t obj)
Compacts the world point array by keeping only selected features.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
DW_API_PUBLIC dwStatus dwReconstructor_estimatePoseAsync(const dwTransformation3f *previousRig2World, const dwTransformation3f *predictedRig2World, const uint32_t listCount, const uint32_t *const d_featureCounts[], const dwFeature2DStatus *const d_statuses[], const dwVector2f *const d_trackedLocations[], const dwVector4f *const d_worldPoints[], dwReconstructorHandle_t obj)
Uses all tracked features from all cameras to estimate the current rig pose.
NVIDIA DriveWorks API: Core Exports
DW_API_PUBLIC dwStatus dwReconstructor_reset(dwReconstructorHandle_t obj)
Resets a reconstructor.
NVIDIA DriveWorks API: Feature Array and Feature History Array
#define DW_API_PUBLIC
Definition: Exports.h:56
dwConstRigHandle_t rig
Specifies the rig to use for reconstruction.
Definition: SFM.h:92
DW_API_PUBLIC dwStatus dwReconstructor_project(dwVector2f *d_locations[], const dwTransformation3f *rig2World, const uint32_t *const d_pointCount[], const dwVector4f *const d_worldPoints[], dwReconstructorHandle_t obj)
Projects triangulated features back to the image.
struct dwReconstructorObject * dwReconstructorHandle_t
Handle representing a reconstructor object.
Definition: SFM.h:81