Skip to content

Commit 6d29bf3

Browse files
authored
Documentation for reconstruction with known camera parameters (#294)
1 parent 90733da commit 6d29bf3

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,31 @@ In a match file, each key corresponds to the string `path0.replace('/', '-')+'_'
185185
`hloc` also provides an interface for image retrieval via `hloc/extract_features.py`. As previously, simply add a new interface to [`hloc/extractors/`](hloc/extractors/). Alternatively, you will need to export the global descriptors into an HDF5 file, in which each key corresponds to the relative path of an image w.r.t. the dataset root, and contains a dataset `global_descriptor` with size D. You can then export the images pairs with [`hloc/pairs_from_retrieval.py`](hloc/pairs_from_retrieval.py).
186186
</details>
187187

188+
### Reconstruction with known camera parameters
189+
190+
<details>
191+
<summary>[Click to expand]</summary>
192+
193+
If the calibration of the camera is known, for example from an external calibration system, you can tell hloc to use these parameters instead of estimating them from EXIF. The name of the camera models and their parameters are [defined by COLMAP](https://colmap.github.io/cameras.html). Python API:
194+
```python
195+
opts = dict(camera_model='SIMPLE_RADIAL', camera_params=','.join(map(str, (f, cx, cy, k))))
196+
model = reconstruction.main(..., image_options=opts)
197+
```
198+
Command-line interface:
199+
```bash
200+
python -m hloc.reconstruction [...] --image_options camera_model='"SIMPLE_RADIAL"' camera_params='"256,256,256,0"'
201+
```
202+
203+
By default, hloc refines the camera parameters during the reconstruction process. To prevent this, add:
204+
```python
205+
reconstruction.main(..., mapper_options=dict(ba_refine_focal_length=False, ba_refine_extra_params=False))
206+
```
207+
```bash
208+
python -m hloc.reconstruction [...] --mapper_options ba_refine_focal_length=False ba_refine_extra_params=False
209+
```
210+
211+
</details>
212+
188213
## Versions
189214

190215
<details>

0 commit comments

Comments
 (0)