DriveWorks SDK Reference

| 0.6.67 Release

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-2016 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_SFM_SFM_H__
46 #define DW_SFM_SFM_H__
47 
48 #include <dw/core/Config.h>
49 #include <dw/features/Features.h>
52 #include <dw/core/Exports.h>
53 #include <dw/core/Context.h>
54 #include <dw/core/Types.h>
55 
56 #include <dw/features/Features.h>
57 
58 #include <cuda_runtime_api.h>
59 
60 #include <stdint.h>
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
73 // dwReconstructor
75 
79 typedef struct dwReconstructorObject *dwReconstructorHandle_t;
80 
82 typedef struct dwReconstructorObject const *dwConstReconstructorHandle_t;
83 
87 typedef struct dwReconstructorConfig {
90 
92  uint32_t maxFeatureCount;
93 
96 
100 
104 
107 
112 
118 
128 
140 dwStatus dwReconstructor_initialize(dwReconstructorHandle_t *obj, dwContextHandle_t context,
141  cudaStream_t stream,
142  const dwReconstructorConfig config);
143 
152 dwStatus dwReconstructor_reset(dwReconstructorHandle_t obj);
153 
166 dwStatus dwReconstructor_release(dwReconstructorHandle_t *obj);
167 
168 
183 dwStatus dwReconstructor_enableCamerasForPoseEstimation(const uint8_t enabled[], dwReconstructorHandle_t obj);
184 
211 dwStatus dwReconstructor_estimatePose(dwTransformation *d_correctedRig2World,
212  const dwTransformation *d_previousRig2World,
213  const dwTransformation *d_predictedRig2World,
214  const uint32_t listCount,
215  const uint32_t * const d_featureCounts[],
216  const dwFeatureStatus * const d_statuses[],
217  const float32_t * const d_trackedLocations[],
218  const float32_t * const d_worldPoints[],
219  dwReconstructorHandle_t obj);
220 
246 dwStatus dwReconstructor_updateHistory(int32_t *rig2WorldHistoryIdx,
247  const dwTransformation *rig2World,
248  const uint32_t listCount,
249  const uint32_t *const d_featureCounts[],
250  const float32_t *const d_trackedLocations[],
251  dwReconstructorHandle_t obj);
252 
271  dwFeatureStatus *d_statuses,
272  const uint32_t *d_featureCount,
273  const uint32_t cameraIdx,
274  dwReconstructorHandle_t obj);
275 
289  const dwTransformation *rig2World,
290  const uint32_t *const d_pointCount[],
291  const float32_t *const d_worldPoints[],
292  dwReconstructorHandle_t obj);
293 
315  uint32_t cameraIdx,
316  const dwTransformation *previousRigToWorld,
317  const dwTransformation *predictedRigToWorld,
318  const uint32_t *d_featureCount,
319  const dwFeatureStatus d_featureStatuses[],
320  const float32_t d_featureLocations[],
321  const float32_t d_worldPoints[],
322  dwReconstructorHandle_t obj);
323 
339 dwStatus dwReconstructor_compactFeatureHistory(const uint32_t cameraIdx,
340  const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes,
341  const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes,
342  dwReconstructorHandle_t obj);
343 
360  const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes,
361  const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes,
362  dwReconstructorHandle_t obj);
363 
376 dwStatus dwReconstructor_setCUDAStream(cudaStream_t stream, dwReconstructorHandle_t obj);
377 
388 dwStatus dwReconstructor_getCUDAStream(cudaStream_t *stream, dwReconstructorHandle_t obj);
389 
390 #ifdef __cplusplus
391 }
392 #endif
393 
396 #endif // DW_SFM_SFM_H__
NVIDIA DriveWorks API: Rig Configuration
DW_API_PUBLIC dwStatus dwReconstructor_project(float32_t *d_locations[], const dwTransformation *rig2World, const uint32_t *const d_pointCount[], const float32_t *const d_worldPoints[], dwReconstructorHandle_t obj)
Projects triangulated features back to the image.
NVIDIA DriveWorks API: Camera Methods
NVIDIA DriveWorks API: Core Types
DW_API_PUBLIC dwStatus dwReconstructor_release(dwReconstructorHandle_t *obj)
Releases a reconstructor.
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:99
float float32_t
Specifies POD types.
Definition: Types.h:77
dwFeatureStatus
Defines the possible status of a feature.
Definition: Features.h:88
uint32_t maxPoseHistoryLength
Specifies the maximum size of the history.
Definition: SFM.h:95
Configuration parameters for a reconstructor.
Definition: SFM.h:87
float32_t poseEstimationOutlierThresholdRad
Specifies the max angle of the reprojection error (angle between tracked optical ray and triangulated...
Definition: SFM.h:116
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:92
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:111
DW_API_PUBLIC dwStatus dwReconstructor_updateHistory(int32_t *rig2WorldHistoryIdx, const dwTransformation *rig2World, const uint32_t listCount, const uint32_t *const d_featureCounts[], const float32_t *const d_trackedLocations[], dwReconstructorHandle_t obj)
Updates the feature and pose history.
DW_API_PUBLIC dwStatus dwReconstructor_enableCamerasForPoseEstimation(const uint8_t enabled[], dwReconstructorHandle_t obj)
Marks the cameras to use for pose estimation.
NVIDIA DriveWorks API: Core Exports
dwStatus
Status definition.
Definition: Status.h:167
DW_API_PUBLIC dwStatus dwReconstructor_triangulateFeatures(float32_t *d_worldPoints, dwFeatureStatus *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. ...
DW_API_PUBLIC dwStatus dwReconstructor_initialize(dwReconstructorHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const dwReconstructorConfig config)
Creates and initializes a reconstructor.
float32_t minRigDistance
Specifies the minimum distance between vehicle poses to add a new one to the list.
Definition: SFM.h:103
uint8_t minTriangulationEntries
Specifies the minimum number of entries in the feature history needed for triangulation.
Definition: SFM.h:106
DW_API_PUBLIC dwStatus dwReconstructor_getCUDAStream(cudaStream_t *stream, dwReconstructorHandle_t obj)
Gets CUDA stream used by the reconstructor.
DW_API_PUBLIC dwStatus dwReconstructor_predictFeaturePosition(float32_t d_predictedLocations[], uint32_t cameraIdx, const dwTransformation *previousRigToWorld, const dwTransformation *predictedRigToWorld, const uint32_t *d_featureCount, const dwFeatureStatus d_featureStatuses[], const float32_t d_featureLocations[], const float32_t d_worldPoints[], dwReconstructorHandle_t obj)
Predicts the positions of features based on the predicted car motion.
struct dwReconstructorObject const * dwConstReconstructorHandle_t
Handle representing a const reconstructor object.
Definition: SFM.h:82
DW_API_PUBLIC dwStatus dwReconstructor_compactFeatureHistory(const uint32_t cameraIdx, const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes, const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes, dwReconstructorHandle_t obj)
Compacts the internal feature history by keeping only selected features.
DW_API_PUBLIC dwStatus dwReconstructor_estimatePose(dwTransformation *d_correctedRig2World, const dwTransformation *d_previousRig2World, const dwTransformation *d_predictedRig2World, const uint32_t listCount, const uint32_t *const d_featureCounts[], const dwFeatureStatus *const d_statuses[], const float32_t *const d_trackedLocations[], const float32_t *const d_worldPoints[], dwReconstructorHandle_t obj)
Uses all tracked features from all cameras to estimate the current rig pose.
dwConstCameraRigHandle_t rig
Specifies the camera rig to use for reconstruction.
Definition: SFM.h:89
DW_API_PUBLIC dwStatus dwReconstructor_setCUDAStream(cudaStream_t stream, dwReconstructorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
DW_API_PUBLIC dwStatus dwReconstructor_compactWorldPoints(float32_t *d_worldPoints, const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes, const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes, dwReconstructorHandle_t obj)
Compacts the world point array by keeping only selected features.
NVIDIA DriveWorks API: 2D Tracker
DW_API_PUBLIC dwStatus dwReconstructor_reset(dwReconstructorHandle_t obj)
Resets a reconstructor.
struct dwCameraRigObject const * dwConstCameraRigHandle_t
Handle representing a const camera rig object.
Definition: Camera.h:217
#define DW_API_PUBLIC
Definition: Exports.h:76
struct dwReconstructorObject * dwReconstructorHandle_t
Handle representing a reconstructor object.
Definition: SFM.h:79