stereo visual odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2...

49
SALMA Stereo Visual Odometry April 26 2019 Victor MARTIN-LAC

Upload: others

Post on 14-Jul-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

SALMA

Stereo Visual Odometry

April 26 2019

Victor MARTIN-LAC

Page 2: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

2

Features

Hardware

● Build a stereo rig

Software

● user interface allowing to

– record multiple view video stream,

– calibrate cameras and stereo rigs,

– compute visual odometry trajectory,

– display trajectory and odometry data.

● stereo visual odometry algorithm.

● algorithm to track calibration target.

● multiple view video stream acquisition.

Page 3: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

3

Numbers

Begun in august 2018

About 20 000 lines of C++

About 1100 € spent

http://github.com/vmartinlac/salma/

Page 4: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Hardware

Page 5: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

5

USB

Ethernet * 2I/O * 2

Rig

Arduino PC

Architecture

Page 6: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

6

Architecture

Take Received Image

Trigger

Process Image

Trigger

Page 7: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

7

Cameras and Lenses

2* Allied Vision TechnologiesManta G125C

Gigabit Ethernet1292 * 964 @ 30 fps

2 * Fujinon TF8DA-8B8mm F/2.2 3-CCD Lens

FoV 33° × 25°

2 * KOWA LM4NCL3.5mm F1.4 – 16FoV 76.7° x 57.7°

Page 8: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

8

The Platform

● Designed in FreeCAD● 3d-printed at http://www.fabric-insa.fr/

Page 9: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

9

Power and Trigger

Page 10: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

10

PC

My PC 500 Go SSD drive Gigabit ethernetexpresscard

Page 11: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

11

Other Stuff

CAT7 RJ45 cable * 2 I/O cable with Hirose12-pin connector * 2

12V 3A DCpower supply

Page 12: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

12

Calibration Targets

https://www.pixartprinting.fr/

Page 13: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

13

Putting It All Together

PC CameraCalibrationTarget

Stereo Rig

Arduino

RigCalibration

Target

Page 14: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Hardware Legacy

Page 15: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

15

The Platform (legacy)

23 cm baseline → hard to produce dense disparity maps in room-scale environment

Page 16: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

16

Ethernet * 2I/O * 2

Rig

Signal Gen. PC

Architecture (legacy)

Hard to associate frames received from several cameras

Page 17: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

17

Power and Trigger (legacy)

24 Hz square wave generator

Page 18: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

18

Calibration Targets (legacy)

Check that background of SVG file is white, not transparent!

Page 19: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Software

Page 20: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

20

Dependencies and ToolsDependencies

● Aravis

● Eigen

● g2o

● libjpeg-turbo

● Nanoflann

● OpenCV

● Openscenegraph

● Qt

● Sophus

Tools:

● C++

● Cmake

Portability: Linux only!

● Aravis only on Linux

● Use of open() stat() write() close()

Page 21: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

21

Software Architecture

slam

persistence

ui

targetmvpnpbuildinfo videocalibration stereomatcher

uicommon

uirecording uicalibration uireconstruction

Page 22: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Software

Video Acquisition & Recording

Page 23: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

23

Video Acquisition

● Rely on Aravis library as implementation of GenICam norm (Vimba SDK from Allied Vision Technologies can be used from only one user thread)

● Some multithreading involved.

● Minimize CPU usage.

Page 24: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

24

Video Recording

● Use libjpeg-turbo for encoding

● Synchronous write on file system

– avoid sudden increase of write time when file system cache gets full.

Page 25: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Software

Detecting the Calibration Target

Page 26: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

26

Detecting the calibration targetAlgorithmic steps:

1) Good Features to Track

2) Thresholding

3) Interest point filtering

4) Computation of topology and edge filtering

5) Propagation of a coordinate system

6) Dots detection and correction of orientation

7) Numbering the points

Page 27: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

27

Detecting the calibration target

(1) (2) (3)

Page 28: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

28

Detecting the calibration target

(4) (5) (6)

Page 29: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

29

Detecting the calibration target

(7) (8) (9)

Page 30: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

30

Detecting the calibration target

Implemented and potential applications of this algorithm:

● Camera calibration (extrinsic and/or intrinsic parameters)

● Rig calibration (relative pose of cameras)

● Pose estimation

Page 31: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Software

Stereo Visual Odometry Method

Page 32: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

32

Why Stereo?Pro stereo:

● Easier initialization

● Scale does not drift

● Handle pure rotation

Pro mono:

● Half cost

● Half amount of data

Page 33: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

33

Algorithm

Triangulation

Stereo Matching

Local Bundle Adjustment

Keyframe Selection

Alignment

Temporal Matching

Feature Extraction

● Sparse indirect method

● Same family as PTAM and ORB-SLAM.

Page 34: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

34

Feature Extraction● Purpose: Detect and describe key points.

● Use ORB features.

Page 35: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

35

Temporal Matching● Purpose: establish 2d-3d correspondences between keypoints and local map points.

● Difference with ORB-SLAM: no projection.

● Match left (right) view with k previous left (right) views.

Page 36: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

36

Alignment● Purpose: compute pose of stereo rig given 2d-3d correspondances.

● Multiple-view perspective-N-points (MVPnP).

● Use Levenberg-Marquardt + RANSAC.

Page 37: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

37

Keyframe Selection● Purpose: decide whether this frame is to be regarded as keyframe or not.

● Check whether translation or rotation angle since last keyframe are above some threshold.

Page 38: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

38

Local Bundle Adjustment● Purpose: adjust poses of last n keyframes and positions of visible mappoints to

minimize reprojection error.

● Multiple view.

Page 39: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

39

Stereo Matching● Purpose: match keypoints from left and right views.

● Criteria: epipolar constraints, Lowe criterion, distance between descriptors.

Page 40: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

40

Triangulation● Purpose: from each stereo match, compute corresponding map point.

● Correction of key point positions according to epipolar constraints (Lindstrom method).

● Middle of common perpendicular.

Page 41: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

41

Results

Page 42: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

42

Results

Page 43: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

43

Runtime● Minimizing runtime is not the focus of the project.

● Pipeline can be CUDA-accelerated if compiled with some CMake option.

● On my Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz

– FEATURES DETECTION: 472 ms

– TEMPORAL MATCHER: 50 ms

– ALIGNMENT: 24 ms

– KEYFRAME SELECTION: 0 ms

– LOCAL BUNDLE ADJUSTMENT: 418 ms

– STEREO MATCHING: 52 ms

– TRIANGULATION: 0 ms

Page 44: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Software

User Friendlinesses

Page 45: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

45

Data Persistence

For each project:

● Images are stored individually on the file system as JPEG.

● Everything else is stored in one main SQLITE database:

● Recording metadata,

● Calibration data,

● Reconstruction data.

Page 46: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

46

User Interface and 3d Visualization● Qt5 for user interface.

● Openscenegraph for 3d visualization.

Page 47: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

Conclusion

Page 48: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

48

● Evaluate odometry precision and robustness

● Implement dense reconstruction (nice to have)

– Experimented with libelas and OpenCV

– Read some papers

What Next?

Page 49: Stereo Visual Odometry - vmlblog.free.frvmlblog.free.fr/projects/slam/diaporama-compressed.pdf · 2 Features Hardware Build a stereo rig Software user interface allowing to – record

49

Thank you for your attention

Questions & Answers