linhuixiao commited on
Commit
2718046
·
verified ·
1 Parent(s): 39677a8

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +321 -0
README.md ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ [//]: # (<br />)
5
+ <p align="center"> <h1 align="center">Dynamic-SLAM: Semantic Monocular Visual Localization and Mapping Based on Deep Learning in Dynamic Environment</h1>
6
+ <p align="center">
7
+ <b> Robotics and Autonomous Systems (RAS), 2019 </b>
8
+ <br />
9
+ <a href="https://scholar.google.com.hk/citations?user=4rTE4ogAAAAJ&hl=zh-CN&oi=sra"><strong> Linhui Xiao </strong></a>
10
+ ·
11
+ <a href="https://scholar.google.com.hk/citations?hl=zh-CN&user=wF8_PgQAAAAJ"><strong>Jinge Wang </strong></a>
12
+ ·
13
+ <a href=""><strong>Xiaosong Qiu </strong></a>
14
+ ·
15
+ <a href="https://www.researchgate.net/scientific-contributions/Zheng-Rong-2212050346"><strong>Zheng Rong </strong></a>
16
+ ·
17
+ <a href="https://scholar.google.com.hk/citations?user=Fku_O9IAAAAJ&hl=zh-CN"><strong>Xudong Zou</strong></a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href='https://www.researchgate.net/profile/Linhui-Xiao/publication/332149941_Dynamic-SLAM_Semantic_monocular_visual_localization_and_mapping_based_on_deep_learning_in_dynamic_environment/links/6013f1fa45851517ef22eb7d/Dynamic-SLAM-Semantic-monocular-visual-localization-and-mapping-based-on-deep-learning-in-dynamic-environment.pdf'>
22
+ <img src='https://img.shields.io/badge/Researchgate-green?style=flat&logo=arXiv&logoColor=green' alt='arXiv PDF'>
23
+ </a>
24
+ <a href='https://www.sciencedirect.com/science/article/abs/pii/S0921889018308029'>
25
+ <img src='https://img.shields.io/badge/RAS 2019-yellow' alt='arXiv PDF'>
26
+ </a>
27
+ <a href='docs/IRCE_2018_Poster_Paper_ID_CE1002-A.pdf'>
28
+ <img src='https://img.shields.io/badge/IEEE IRCE 2018 Best Oral-blue' alt='arXiv PDF'>
29
+ </a>
30
+
31
+ <br />
32
+
33
+
34
+ <p align="center"> <img src='docs/pipline.jpg' align="center" width="100%"> </p>
35
+
36
+ **<p align="center"> Dynamic-SLAM Pipline. </p>**
37
+
38
+
39
+ <p align="center"> <img src='docs/model.jpg' align="center" width="60%"> </p>
40
+
41
+ **<p align="center"> Dynamic-SLAM Framework. </p>**
42
+
43
+ <p align="center"> <img src='docs/KITTI.jpg' align="center" width="100%"> </p>
44
+
45
+ **<p align="center"> KITTI Datasets Localization Results (APE and Trajectory). </p>**
46
+
47
+ <p align="center"> <img src='docs/KITTI2.jpg' align="center" width="100%"> </p>
48
+
49
+ **<p align="center"> KITTI Datasets Localization Results (Real Time). </p>**
50
+
51
+
52
+ This repository is the official C++ implementation for the paper [**Dynamic-SLAM: Semantic Monocular Visual Localization and Mapping Based on Deep Learning in Dynamic Environment**](https://www.sciencedirect.com/science/article/abs/pii/S0921889018308029).
53
+
54
+ If you have any questions, please feel free to open an issue or contact me with emails: <xiaolinhui16@mails.ucas.ac.cn>.
55
+
56
+ <h3 align="left">
57
+ Links: <a href="https://www.sciencedirect.com/science/article/abs/pii/S0921889018308029">ELSEVIER Robotics and Autonomous Systems (RAS 2019)</a>,
58
+ <a href="https://www.researchgate.net/profile/Linhui-Xiao/publication/332149941_Dynamic-SLAM_Semantic_monocular_visual_localization_and_mapping_based_on_deep_learning_in_dynamic_environment/links/6013f1fa45851517ef22eb7d/Dynamic-SLAM-Semantic-monocular-visual-localization-and-mapping-based-on-deep-learning-in-dynamic-environment.pdf">Researchgate</a>,
59
+ </h3>
60
+
61
+ This paper also obtained the [**IEEE IRCE Best Oral**](docs/IRCE_Best_Oral.jpg) and [**IEEE IRCE Best Poster**](docs/IRCE_Best_Poster.jpg) in [**IEEE IRCE 2018**](https://irce.org/2018.html).
62
+ The poster [**download**](docs/IRCE_2018_Poster_Paper_ID_CE1002-A.pdf).
63
+
64
+ **Please leave a <font color='orange'>STAR ⭐</font> if you like this project!**
65
+
66
+
67
+ If you find our work helpful for your research, please consider citing the following BibTeX entry.
68
+
69
+ ```bibtex
70
+ @article{xiao2019dynamic,
71
+ title={Dynamic-SLAM: Semantic monocular visual localization and mapping based on deep learning in dynamic environment},
72
+ author={Xiao, Linhui and Wang, Jinge and Qiu, Xiaosong and Rong, Zheng and Zou, Xudong},
73
+ journal={Robotics and Autonomous Systems},
74
+ volume={117},
75
+ pages={1--16},
76
+ year={2019},
77
+ publisher={Elsevier}
78
+ }
79
+ ```
80
+
81
+
82
+
83
+ **Dynamic-SLAM is a project developed based on ORB-SLAM2, and its environment and operation are exactly the same as ORB-SLAM2.
84
+ Below is the original environment configuration flow for ORB-SLAM2.**
85
+
86
+ --------------------
87
+ --------------------
88
+
89
+
90
+ **13 Jan 2017**: OpenCV 3 and Eigen 3.3 are now supported.
91
+
92
+ **22 Dec 2016**: Added AR demo (see section 7).
93
+
94
+ ORB-SLAM2 is a real-time SLAM library for **Monocular**, **Stereo** and **RGB-D** cameras that computes the camera trajectory and a sparse 3D reconstruction (in the stereo and RGB-D case with true scale). It is able to detect loops and relocalize the camera in real time. We provide examples to run the SLAM system in the [KITTI dataset](http://www.cvlibs.net/datasets/kitti/eval_odometry.php) as stereo or monocular, in the [TUM dataset](http://vision.in.tum.de/data/datasets/rgbd-dataset) as RGB-D or monocular, and in the [EuRoC dataset](http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets) as stereo or monocular. We also provide a ROS node to process live monocular, stereo or RGB-D streams. **The library can be compiled without ROS**. ORB-SLAM2 provides a GUI to change between a *SLAM Mode* and *Localization Mode*, see section 9 of this document.
95
+
96
+ <a href="https://www.youtube.com/embed/ufvPS5wJAx0" target="_blank"><img src="http://img.youtube.com/vi/ufvPS5wJAx0/0.jpg"
97
+ alt="ORB-SLAM2" width="240" height="180" border="10" /></a>
98
+ <a href="https://www.youtube.com/embed/T-9PYCKhDLM" target="_blank"><img src="http://img.youtube.com/vi/T-9PYCKhDLM/0.jpg"
99
+ alt="ORB-SLAM2" width="240" height="180" border="10" /></a>
100
+ <a href="https://www.youtube.com/embed/kPwy8yA4CKM" target="_blank"><img src="http://img.youtube.com/vi/kPwy8yA4CKM/0.jpg"
101
+ alt="ORB-SLAM2" width="240" height="180" border="10" /></a>
102
+
103
+
104
+ ###Related Publications:
105
+
106
+ [Monocular] Raúl Mur-Artal, J. M. M. Montiel and Juan D. Tardós. **ORB-SLAM: A Versatile and Accurate Monocular SLAM System**. *IEEE Transactions on Robotics,* vol. 31, no. 5, pp. 1147-1163, 2015. (**2015 IEEE Transactions on Robotics Best Paper Award**). **[PDF](http://webdiis.unizar.es/~raulmur/MurMontielTardosTRO15.pdf)**.
107
+
108
+ [Stereo and RGB-D] Raúl Mur-Artal and Juan D. Tardós. **ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras**. *ArXiv preprint arXiv:1610.06475* **[PDF](https://128.84.21.199/pdf/1610.06475.pdf)**.
109
+
110
+ [DBoW2 Place Recognizer] Dorian Gálvez-López and Juan D. Tardós. **Bags of Binary Words for Fast Place Recognition in Image Sequences**. *IEEE Transactions on Robotics,* vol. 28, no. 5, pp. 1188-1197, 2012. **[PDF](http://doriangalvez.com/php/dl.php?dlp=GalvezTRO12.pdf)**
111
+
112
+ #1. License
113
+
114
+ ORB-SLAM2 is released under a [GPLv3 license](https://github.com/raulmur/ORB_SLAM2/blob/master/License-gpl.txt). For a list of all code/library dependencies (and associated licenses), please see [Dependencies.md](https://github.com/raulmur/ORB_SLAM2/blob/master/Dependencies.md).
115
+
116
+ For a closed-source version of ORB-SLAM2 for commercial purposes, please contact the authors: orbslam (at) unizar (dot) es.
117
+
118
+ If you use ORB-SLAM2 (Monocular) in an academic work, please cite:
119
+
120
+ @article{murTRO2015,
121
+ title={{ORB-SLAM}: a Versatile and Accurate Monocular {SLAM} System},
122
+ author={Mur-Artal, Ra\'ul, Montiel, J. M. M. and Tard\'os, Juan D.},
123
+ journal={IEEE Transactions on Robotics},
124
+ volume={31},
125
+ number={5},
126
+ pages={1147--1163},
127
+ doi = {10.1109/TRO.2015.2463671},
128
+ year={2015}
129
+ }
130
+
131
+ if you use ORB-SLAM2 (Stereo or RGB-D) in an academic work, please cite:
132
+
133
+ @article{murORB2,
134
+ title={{ORB-SLAM2}: an Open-Source {SLAM} System for Monocular, Stereo and {RGB-D} Cameras},
135
+ author={Mur-Artal, Ra\'ul and Tard\'os, Juan D.},
136
+ journal={arXiv preprint arXiv:1610.06475},
137
+ year={2016}
138
+ }
139
+
140
+ #2. Prerequisites
141
+ We have tested the library in **Ubuntu 12.04**, **14.04** and **16.04**, but it should be easy to compile in other platforms. A powerful computer (e.g. i7) will ensure real-time performance and provide more stable and accurate results.
142
+
143
+ ## C++11 or C++0x Compiler
144
+ We use the new thread and chrono functionalities of C++11.
145
+
146
+ ## Pangolin
147
+ We use [Pangolin](https://github.com/stevenlovegrove/Pangolin) for visualization and user interface. Dowload and install instructions can be found at: https://github.com/stevenlovegrove/Pangolin.
148
+
149
+ ## OpenCV
150
+ We use [OpenCV](http://opencv.org) to manipulate images and features. Dowload and install instructions can be found at: http://opencv.org. **Required at leat 2.4.3. Tested with OpenCV 2.4.11 and OpenCV 3.2**.
151
+
152
+ ## Eigen3
153
+ Required by g2o (see below). Download and install instructions can be found at: http://eigen.tuxfamily.org. **Required at least 3.1.0**.
154
+
155
+ ## DBoW2 and g2o (Included in Thirdparty folder)
156
+ We use modified versions of the [DBoW2](https://github.com/dorian3d/DBoW2) library to perform place recognition and [g2o](https://github.com/RainerKuemmerle/g2o) library to perform non-linear optimizations. Both modified libraries (which are BSD) are included in the *Thirdparty* folder.
157
+
158
+ ## ROS (optional)
159
+ We provide some examples to process the live input of a monocular, stereo or RGB-D camera using [ROS](ros.org). Building these examples is optional. In case you want to use ROS, a version Hydro or newer is needed.
160
+
161
+ #3. Building ORB-SLAM2 library and TUM/KITTI examples
162
+
163
+ Clone the repository:
164
+ ```
165
+ git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
166
+ ```
167
+
168
+ We provide a script `build.sh` to build the *Thirdparty* libraries and *ORB-SLAM2*. Please make sure you have installed all required dependencies (see section 2). Execute:
169
+ ```
170
+ cd ORB_SLAM2
171
+ chmod +x build.sh
172
+ ./build.sh
173
+ ```
174
+
175
+ This will create **libORB_SLAM2.so** at *lib* folder and the executables **mono_tum**, **mono_kitti**, **rgbd_tum**, **stereo_kitti**, **mono_euroc** and **stereo_euroc** in *Examples* folder.
176
+
177
+ #4. Monocular Examples
178
+
179
+ ## TUM Dataset
180
+
181
+ 1. Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
182
+
183
+ 2. Execute the following command. Change `TUMX.yaml` to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. Change `PATH_TO_SEQUENCE_FOLDER`to the uncompressed sequence folder.
184
+ ```
185
+ ./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
186
+ ```
187
+
188
+ ## KITTI Dataset
189
+
190
+ 1. Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
191
+
192
+ 2. Execute the following command. Change `KITTIX.yaml`by KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11.
193
+ ```
194
+ ./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
195
+ ```
196
+
197
+ ## EuRoC Dataset
198
+
199
+ 1. Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
200
+
201
+ 2. Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
202
+ ```
203
+ ./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE_FOLDER/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
204
+ ```
205
+
206
+ ```
207
+ ./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
208
+ ```
209
+
210
+ #5. Stereo Examples
211
+
212
+ ## KITTI Dataset
213
+
214
+ 1. Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
215
+
216
+ 2. Execute the following command. Change `KITTIX.yaml`to KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. Change `PATH_TO_DATASET_FOLDER` to the uncompressed dataset folder. Change `SEQUENCE_NUMBER` to 00, 01, 02,.., 11.
217
+ ```
218
+ ./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
219
+ ```
220
+
221
+ ## EuRoC Dataset
222
+
223
+ 1. Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
224
+
225
+ 2. Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
226
+ ```
227
+ ./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/mav0/cam0/data PATH_TO_SEQUENCE/mav0/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
228
+ ```
229
+ ```
230
+ ./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/cam0/data PATH_TO_SEQUENCE/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
231
+ ```
232
+
233
+ #6. RGB-D Example
234
+
235
+ ## TUM Dataset
236
+
237
+ 1. Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
238
+
239
+ 2. Associate RGB images and depth images using the python script [associate.py](http://vision.in.tum.de/data/datasets/rgbd-dataset/tools). We already provide associations for some of the sequences in *Examples/RGB-D/associations/*. You can generate your own associations file executing:
240
+
241
+ ```
242
+ python associate.py PATH_TO_SEQUENCE/rgb.txt PATH_TO_SEQUENCE/depth.txt > associations.txt
243
+ ```
244
+
245
+ 3. Execute the following command. Change `TUMX.yaml` to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. Change `PATH_TO_SEQUENCE_FOLDER`to the uncompressed sequence folder. Change `ASSOCIATIONS_FILE` to the path to the corresponding associations file.
246
+
247
+ ```
248
+ ./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILE
249
+ ```
250
+
251
+ #7. ROS Examples
252
+
253
+ ### Building the nodes for mono, monoAR, stereo and RGB-D
254
+ 1. Add the path including *Examples/ROS/ORB_SLAM2* to the ROS_PACKAGE_PATH environment variable. Open .bashrc file and add at the end the following line. Replace PATH by the folder where you cloned ORB_SLAM2:
255
+
256
+ ```
257
+ export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM2/Examples/ROS
258
+ ```
259
+
260
+ 2. Execute `build_ros.sh` script:
261
+
262
+ ```
263
+ chmod +x build_ros.sh
264
+ ./build_ros.sh
265
+ ```
266
+
267
+ ### Running Monocular Node
268
+ For a monocular input from topic `/camera/image_raw` run node ORB_SLAM2/Mono. You will need to provide the vocabulary file and a settings file. See the monocular examples above.
269
+
270
+ ```
271
+ rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
272
+ ```
273
+
274
+ ### Running Monocular Augmented Reality Demo
275
+ This is a demo of augmented reality where you can use an interface to insert virtual cubes in planar regions of the scene.
276
+ The node reads images from topic `/camera/image_raw`.
277
+
278
+ ```
279
+ rosrun ORB_SLAM2 MonoAR PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
280
+ ```
281
+
282
+ ### Running Stereo Node
283
+ For a stereo input from topic `/camera/left/image_raw` and `/camera/right/image_raw` run node ORB_SLAM2/Stereo. You will need to provide the vocabulary file and a settings file. If you **provide rectification matrices** (see Examples/Stereo/EuRoC.yaml example), the node will recitify the images online, **otherwise images must be pre-rectified**.
284
+
285
+ ```
286
+ rosrun ORB_SLAM2 Stereo PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE ONLINE_RECTIFICATION
287
+ ```
288
+
289
+ **Example**: Download a rosbag (e.g. V1_01_easy.bag) from the EuRoC dataset (http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets). Open 3 tabs on the terminal and run the following command at each tab:
290
+ ```
291
+ roscore
292
+ ```
293
+
294
+ ```
295
+ rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true
296
+ ```
297
+
298
+ ```
299
+ rosbag play --pause V1_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
300
+ ```
301
+
302
+ Once ORB-SLAM2 has loaded the vocabulary, press space in the rosbag tab. Enjoy!. Note: a powerful computer is required to run the most exigent sequences of this dataset.
303
+
304
+ ### Running RGB_D Node
305
+ For an RGB-D input from topics `/camera/rgb/image_raw` and `/camera/depth_registered/image_raw`, run node ORB_SLAM2/RGBD. You will need to provide the vocabulary file and a settings file. See the RGB-D example above.
306
+
307
+ ```
308
+ rosrun ORB_SLAM2 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
309
+ ```
310
+
311
+ #8. Processing your own sequences
312
+ You will need to create a settings file with the calibration of your camera. See the settings file provided for the TUM and KITTI datasets for monocular, stereo and RGB-D cameras. We use the calibration model of OpenCV. See the examples to learn how to create a program that makes use of the ORB-SLAM2 library and how to pass images to the SLAM system. Stereo input must be synchronized and rectified. RGB-D input must be synchronized and depth registered.
313
+
314
+ #9. SLAM and Localization Modes
315
+ You can change between the *SLAM* and *Localization mode* using the GUI of the map viewer.
316
+
317
+ ### SLAM Mode
318
+ This is the default mode. The system runs in parallal three threads: Tracking, Local Mapping and Loop Closing. The system localizes the camera, builds new map and tries to close loops.
319
+
320
+ ### Localization Mode
321
+ This mode can be used when you have a good map of your working area. In this mode the Local Mapping and Loop Closing are deactivated. The system localizes the camera in the map (which is no longer updated), using relocalization if needed.