DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/samples/imageprocessing/sfm/README.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_struct_from_motion_sample Structure from Motion (SFM) Sample
4 @tableofcontents
5 
6 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 
8 @section dwx_struct_from_motion_description Description
9 
10 The Structure from Motion (SFM) sample demonstrates the triangulation functionality of
11 the SFM module; a car pose is estimated entirely from CAN data using the NVIDIA<sup>&reg;</sup>
12 DriveWorks egomotion module. The car has a 4-fisheye camera rig that is pre-calibrated.
13 Features are detected and tracked using the features module. Points are
14 triangulated for each frame by using the estimated pose and tracked features.
15 
16 @section dwx_struct_from_motion_running Running the Sample
17 
18 The structure from motion sample, sample_sfm, accepts the following optional parameters. If none are specified, it will process four supplied pre-recorded video.
19 
20  ./sample_sfm --baseDir=[path/to/rig/dir]
21  --rig=[rig.json]
22  --dbc=[canbus_file]
23  --dbcSpeed=[signal_name]
24  --dbcSteering=[signal_name]
25  --maxFeatureCount=[integer]
26 
27 where
28 
29  --baseDir=[path/to/rig/dir]
30  Path to the folder containint the rig.json file.
31  Default value: path/to/data/samples/sfm/triangulation
32 
33  --rig=[rig.json]
34  A `rig.json` file as serialized by the DriveWorks rig module, or as produced by the DriveWorks calibration tool.
35  The rig must include the 4 camera sensors and one CAN sensor.
36  The rig sensors must contain valid protocol and parameter properties to open the virtual sensors.
37  The video files must be a H.264 stream.
38  Video containers as MP4, AVI, MKV, etc. are not supported.
39  The rig file also points to a video timestamps text file where each row contains the frame index
40  (starting at 1) and the timestamp for all cameras. It is read by the camera virtual sensor.
41  Default value: rig.json
42 
43  --dbc=[canbus_file]
44  The CAN bus file that is required by the canbus virtual sensor.
45  Default value: canbus.dbc
46 
47  --dbcSpeed=[signal_name]
48  Name of the signal corresponding to the car speed in the given dbc file.
49  Default value: M_SPEED.CAN_CAR_SPEED
50 
51  --dbcSteering=[signal_name]
52  Name of the signal corresponding to the steering angle in the given dbc file.
53  Default value: M_STEERING.CAN_CAR_STEERING
54 
55  --maxFeatureCount=[integer]
56  The manixum amount of features stored for tracking.
57  Default value: 2000
58 
59 If a mouse is available, the left button rotates the 3D view, the right button
60 translate, and the mouse wheel zooms.
61 
62 While the sample is running the following commands are available:
63 - Press V to enable / disable pose estimation.
64 - Press F to enable / disable feature position prediction.
65 - Press Space to pause / resume execution.
66 - Press Q to switch between different camera views.
67 - Press R to restart playback.
68 
69 @section dwx_struct_from_motion_output Output
70 
71 The left side of the screen shows the 4 input images; tracked features are shown
72 in green. Triangulated points are reprojected back onto the camera and shown in
73 red. The right side shows a 3D view of the triangulated point cloud.
74 
75 In 3D, the colors are:
76 
77 - Red points = points from frontal camera
78 - Green points = points from rear camera
79 - Blue points = points from left camera
80 - Yellow points = points from right camera
81 - Green/red line = path of the car
82 
83 ![Structure from Motion sample](sample_triangulation.png)
84 
85 @section dwx_struct_from_motion_more Additional Information
86 
87 For more details see @ref sfm_mainsection .