Skip to content

Commit 0fd3991

Browse files
authored
Merge pull request #50 from 3DOM-FBK/dev-multicamera
Dev multicamera
2 parents b7c7d68 + 6bea5be commit 0fd3991

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+879
-791220
lines changed

.github/workflows/run_test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: run-test
22

33
on:
44
push:
5-
branches: [master, dev]
5+
branches: "*" # Run on all branches
66
pull_request:
77
branches: [master, dev]
88

@@ -29,7 +29,6 @@ jobs:
2929
python -m pip install --upgrade pip
3030
pip install -e .
3131
pip install pycolmap
32-
pip install einops
3332
- name: Test with pytest
3433
run: |
3534
pytest

.github/workflows/run_test_win.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: run-test
1+
name: run-test-win
22

33
on:
44
push:
5-
branches: [master, dev]
5+
branches: "*" # Run on all branches
66
pull_request:
77
branches: [master, dev]
88

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fra_*
1010
sb_*
1111
config.yaml
1212
run_casalbagliano.sh
13+
config/cameras_test.yaml
1314

1415
# VScode
1516
.vscode/

README.md

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<div align="center">
22

3-
[![Static Badge](https://img.shields.io/badge/Matches_for-COLMAP-red)](https://github.com/colmap/colmap)
4-
![Static Badge](https://img.shields.io/badge/Matches_for-Metashape-blue) [![Static Badge](https://img.shields.io/badge/Powered_by-Kornia-green)](https://github.com/kornia/kornia) [![Static Badge](https://img.shields.io/badge/Powered_by-hloc-blue)](https://github.com/kornia/kornia)
3+
[![Static Badge](https://img.shields.io/badge/Matches_for-COLMAP-red)](https://github.com/colmap/colmap) [![Static Badge](https://img.shields.io/badge/Matches_for-OpenMVG-red)](https://github.com/openMVG/openMVG) [![Static Badge](https://img.shields.io/badge/Matches_for-MICMAC-red)](https://github.com/micmacIGN/micmac) ![Static Badge](https://img.shields.io/badge/Matches_for-Metashape-red)
54

6-
[![GitHub Release](https://img.shields.io/github/v/release/3DOM-FBK/deep-image-matching)](https://github.com/3DOM-FBK/deep-image-matching/releases) [![Static Badge](https://img.shields.io/badge/docs-DeepImageMatching-blue
5+
[![Static Badge](https://img.shields.io/badge/Powered_by-Kornia-green)](https://github.com/kornia/kornia) [![Static Badge](https://img.shields.io/badge/Powered_by-hloc-green)](https://github.com/kornia/kornia) [![GitHub Release](https://img.shields.io/github/v/release/3DOM-FBK/deep-image-matching)](https://github.com/3DOM-FBK/deep-image-matching/releases) [![Static Badge](https://img.shields.io/badge/docs-DeepImageMatching-blue
76
)](https://3dom-fbk.github.io/deep-image-matching/)
87

98
</div>
@@ -18,21 +17,20 @@
1817
| ----------------------------------------------------- | --------------------------------------------------------- |
1918
| <img src='docs/assets/temple_rsift.gif' height="165"> | <img src='docs/assets/temple_superglue.gif' height="165"> |
2019

21-
Multivew matcher for SfM software. Support both deep-learning based and hand-crafted local features and matchers and export keypoints and matches directly in a COLMAP database or to Agisoft Metashape by importing the reconstruction in Bundler format. It supports both CLI and GUI. Feel free to collaborate!
20+
Multivew matcher for SfM software. Support both deep-learning based and hand-crafted local features and matchers and export keypoints and matches directly in a COLMAP database or to Agisoft Metashape by importing the reconstruction in Bundler format. Now, it supports both OpenMVG and MicMac. Feel free to collaborate!
2221

2322
Check the documentation at <a href="https://3dom-fbk.github.io/deep-image-matching/">Docs</a>.
2423

25-
**Please, note that `deep-image-matching` is under active development** and it is still in an experimental stage. If you find any bug, please open an issue.
24+
While `dev` branch is more frequently updated, `master` is the default more stable branch and is updated from `dev` less frequently. If you are looking for the newest developments, please switch to `dev`. **Please, note that `deep-image-matching` is under active development** and it is still in an experimental stage. If you find any bug, please open an issue.
2625

2726
Key features:
2827

29-
- [x] Multiview
30-
- [x] Large format images
31-
- [x] SOTA deep-learning and hand-crafted features
32-
- [x] Full compatibility with COLMAP
33-
- [x] Support for image rotations
34-
- [x] Compatibility with Agisoft Metashape (only on Linux and MacOS by using pycolmap)
35-
- [x] Support image retrieval with deep-learning local features
28+
- Multiview
29+
- Large format images
30+
- SOTA deep-learning and hand-crafted features
31+
- Support for image rotations
32+
- Compatibility with several SfM software
33+
- Support image retrieval with deep-learning local features
3634

3735
| Supported Extractors | Supported Matchers |
3836
| ---------------------------------- | --------------------------------------------------------- |
@@ -78,14 +76,12 @@ cd deep-image-matching
7876
pip install -e .
7977
```
8078

81-
Install pycolmap:
79+
Install pycolmap (optional):
8280

8381
```bash
84-
pip install pycolmap
82+
pip install pycolmap==0.6.1
8583
```
86-
87-
As [pycolmap](https://github.com/colmap/pycolmap) was released on PyPi only for Linux and macOS (up to version 0.4.0), it is not installed by default with deep-image-matching.
88-
From version 0.5.0, pycolmap can be installed on Windows too. However, it will demand some testing before being added to the dependencies of deep-image-matching, as there are some errors on Windows that are blocking deep_image_matching pipeline (while it works completely fine on Linux).
84+
Pycolmap is optional to run reconstruction directly in DIM. If pycolmap is not available, matches will be written both in a h5 and colmap database for later processing with COLMAP GUI or API, or other processing.
8985

9086
For more information, check the [documentation](https://3dom-fbk.github.io/deep-image-matching/installation/).
9187

@@ -122,7 +118,7 @@ If you face any issues, especially on Linux when using the `gpus all` setting, p
122118

123119
## Usage instructions
124120

125-
You can run deep-image-matching from the command line or from the GUI.
121+
<!-- This is a comment You can run deep-image-matching from the command line or from the GUI. -->
126122

127123
Use the following command to see all the available options from the CLI:
128124

@@ -138,12 +134,12 @@ python main.py --dir assets/example_cyprus --pipeline superpoint+lightglue
138134

139135
For all the usage instructions and configurations, refer to the documenation at [https://3dom-fbk.github.io/deep-image-matching/](https://3dom-fbk.github.io/deep-image-matching/getting_started) or check the example notebooks.
140136

141-
To run the GUI, you can use the following command:
137+
<!--To run the GUI, you can use the following command:
142138
143139
```bash
144140
python main.py --gui
145141
146-
```
142+
```-->
147143

148144
## Advanced usage
149145

@@ -155,7 +151,7 @@ To run the matching with different local features and/or matchers and marging to
155151

156152
```bash
157153
python ./join_databases.py --help
158-
python ./join_databases.py --input assets/to_be_joined --output docs/assets/to_be_joined
154+
python ./join_databases.py --input path/to/dir/with/databases --output path/to/output/dir
159155
```
160156

161157
### Exporting the solution to Metashape
@@ -182,14 +178,14 @@ See the [TODO list](notes.md) for the list of features and improvements that are
182178
If you find the repository useful for your work consider citing the papers:
183179

184180
```bibtex
185-
@Article{morelli2024_deep_image_matching,
186-
AUTHOR = {Morelli, L. and Ioli, F. and Maiwald, F. and Mazzacca, G. and Menna, F. and Remondino, F.},
187-
TITLE = {DEEP-IMAGE-MATCHING: A TOOLBOX FOR MULTIVIEW IMAGE MATCHING OF COMPLEX SCENARIOS},
188-
JOURNAL = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
189-
VOLUME = {XLVIII-2/W4-2024},
190-
YEAR = {2024},
191-
PAGES = {309--316},
192-
DOI = {10.5194/isprs-archives-XLVIII-2-W4-2024-309-2024}
181+
@article{morelli2024_deep_image_matching,
182+
AUTHOR = {Morelli, L. and Ioli, F. and Maiwald, F. and Mazzacca, G. and Menna, F. and Remondino, F.},
183+
TITLE = {DEEP-IMAGE-MATCHING: A TOOLBOX FOR MULTIVIEW IMAGE MATCHING OF COMPLEX SCENARIOS},
184+
JOURNAL = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
185+
VOLUME = {XLVIII-2/W4-2024},
186+
YEAR = {2024},
187+
PAGES = {309--316},
188+
DOI = {10.5194/isprs-archives-XLVIII-2-W4-2024-309-2024}
193189
}
194190
```
195191

@@ -216,4 +212,10 @@ Dynamics Monitoring},
216212
}
217213
```
218214

219-
Depending on the options used, consider citing the corresponding work of [KORNIA](https://github.com/kornia/kornia), [HLOC](https://github.com/cvg/Hierarchical-Localization), and local features.
215+
Depending on the options used, consider citing the corresponding work of:
216+
- [KORNIA](https://github.com/kornia/kornia)
217+
- [HLOC](https://github.com/cvg/Hierarchical-Localization)
218+
- [COLMAP](https://github.com/colmap/colmap)
219+
- [OpenMVG](https://github.com/openMVG/openMVG)
220+
- [MICMAC](https://github.com/micmacIGN/micmac)
221+
- used local features and matchers

config/cameras.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
general:
2+
camera_model: "pinhole" # ["simple-pinhole", "pinhole", "simple-radial", "opencv"]
3+
openmvg_camera_model: "pinhole_radial_k3" # ["pinhole", "pinhole_radial_k3", "pinhole_brown_t2"]
4+
single_camera: True
5+
6+
cam0:
7+
camera_model: "pinhole"
8+
images : ""
9+
10+
cam1:
11+
camera_model: "pinhole"
12+
images : "DSC_6468.jpg,DSC_6468.jpg"

config/openmvg.yaml

-4
This file was deleted.

config/openmvg_linux.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
general:
2+
path_to_binaries: null # If None, the binaries are assumed to be in the PATH
3+
openmvg_database: null # If None, it will be downloaded from the openMVG repository

config/openmvg_win.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
general:
2+
path_to_binaries: C:\Users\threedom\Desktop\OpenMVG\ReleaseV1.6.Halibut.WindowsBinaries_VS2017\ReleaseV1.6.Halibut.WindowsBinaries_VS2017
3+
openmvg_database: C:\Users\threedom\Desktop\OpenMVG\ReleaseV1.6.Halibut.WindowsBinaries_VS2017\ReleaseV1.6.Halibut.WindowsBinaries_VS2017\sensor_width_database\sensor_width_camera_database.txt

docs/advanced_usage.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Advanced Usage
2+
3+
**Page under construction...**

docs/camera_models.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Camera model options
2+
3+
For the COLMAP database, by default, DIM assigns camera models to images based on the options loaded from the `config/cameras.yaml` file, unless otherwise specified.
4+
5+
For images not assigned to specific `cam<x>` camera groups, the options specified under `general` are applied. The camera_model can be selected from `["simple-pinhole", "pinhole", "simple-radial", "opencv"]`. It's worth noting that it's easily possible to extend this to include all the classical COLMAP camera models. Cameras can either be shared among all images (`single_camera == True`), or each camera can have a different camera model (`single_camera == False`).
6+
7+
A subset of images can share intrinsics with `cam<x>` by specifying the `camera_model` along with the names of the images separated by commas. For instance:
8+
9+
```
10+
cam0:
11+
camera_model: "pinhole"
12+
images: "DSC_6468.jpg,DSC_6469.jpg"
13+
```
14+
15+
There's no limit to the number of `cam<x>` entries you can use, just add them following the provided format.
16+
17+
A comprehensive example of a `cameras.yaml` file can be found in the `config` folder:
18+
19+
```
20+
general:
21+
camera_model: "pinhole" # ["simple-pinhole", "pinhole", "simple-radial", "opencv"]
22+
openmvg_camera_model: "pinhole_radial_k3" # ["pinhole", "pinhole_radial_k3", "pinhole_brown_t2"]
23+
single_camera: True
24+
25+
cam0:
26+
camera_model: "pinhole"
27+
images : ""
28+
29+
cam1:
30+
camera_model: "pinhole"
31+
images : "DSC_6468.jpg,DSC_6468.jpg"
32+
```
33+
34+
For OpenMVG and MICMAC, refer to their respective sections.

docs/colmap.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Use with COLMAP and pyCOLMAP
2+
3+
**Page under construction...**

docs/examples.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Usage examples
2+
3+
**Page under construction...**

docs/getting_started.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Deep-Image-Matching can be launched from the Command Line (CLI), from the GUI (note that the GUI is still under development) or use Deep_Image_Matching as a Python library.
44

5+
In `assets` folder there are some projects and images for testing.
6+
57
## Run Deep-Image-Matching
68

79
### Command Line Interface (CLI)
@@ -10,9 +12,11 @@ Before running the CLI, check the options with `python ./main.py --help`.
1012

1113
The minimal required option are:
1214

13-
- `--dir` `-d`: it is the path of the 'project directory', i.e., the directory containing a folder names 'images', with all the image to be processed, and where the output will be saved
15+
- `--dir` `-d`: it is the path of the 'project directory', i.e., the directory containing a folder named 'images', with all the image to be processed, and where the output will be saved
1416
- `--pipeline` `-p`: the name of pipeline (i.e., the combination of local feature extractor and matcher) to use (e.g., "superpoint+lightglue"). See the [Local feature extractor and matcher](#local-feature-extractor-and-matcher) section for more details.
1517

18+
Example: `python main.py --dir ./assets/example_cyprus --pipeline superpoint+lightglue`
19+
1620
Other optional parameters are:
1721

1822
- `--config_file` `-c`: the path to the YAML configuration file containing the custom configuration. See the [Advanced configuration](#advanced-configuration) section (default: `None`, so default configuration is used)

docs/index.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88
| -------------------------------------------------- | ------------------------------------------------------ |
99
| <img src='./assets/temple_rsift.gif' height="165"> | <img src='./assets/temple_superglue.gif' height="165"> |
1010

11-
Multivew matcher for SfM software. Support both deep-learning based and hand-crafted local features and matchers and export keypoints and matches directly in a COLMAP database or to Agisoft Metashape by importing the reconstruction in Bundler format. It supports both CLI and GUI. Feel free to collaborate!
11+
Multivew matcher for SfM software. Support both deep-learning based and hand-crafted local features and matchers and export keypoints and matches directly in a COLMAP database or to Agisoft Metashape by importing the reconstruction in Bundler format. Now, it supports both OpenMVG and MicMac. Feel free to collaborate!
12+
13+
While `dev` branch is more frequently updated, `master` is the default more stable branch and is updated from `dev` less frequently. If you are looking for the newest developments, please switch to `dev`.
1214

1315
**Please, note that `deep-image-matching` is under active development** and it is still in an experimental stage. If you find any bug, please open an issue.
1416

1517
Key features:
1618

17-
- [x] Multiview
18-
- [x] Large format images
19-
- [x] SOTA deep-learning and hand-crafted features
20-
- [x] Full compatibility with COLMAP
21-
- [x] Support for image rotations
22-
- [x] Compatibility with Agisoft Metashape (only on Linux and MacOS by using pycolmap)
23-
- [x] Support image retrieval with deep-learning local features
19+
- Multiview
20+
- Large format images
21+
- SOTA deep-learning and hand-crafted features
22+
- Support for image rotations
23+
- Compatibility with several SfM software
24+
- Support image retrieval with deep-learning local features
2425

2526
| Supported Extractors | Supported Matchers |
2627
| ---------------------------------- | --------------------------------------------------------- |

docs/installation.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ cd deep-image-matching
2525
pip install -e .
2626
```
2727

28-
Install pycolmap:
28+
Install pycolmap (optional):
2929

3030
```bash
31-
pip install pycolmap
31+
pip install pycolmap==0.6.1
3232
```
33+
Pycolmap is optional to run reconstruction directly in DIM. If pycolmap is not available, matches will be written both in a h5 and colmap database for later processing with COLMAP GUI or API, or other processing.
3334

34-
Up to version 0.4.0, [pycolmap](https://github.com/colmap/pycolmap) was released on PyPi only for Linux and macOS.
35-
Therefore, it was not included in the dependencies of deep-image-matching, so you need to install it manually.
36-
From [version 0.5.0](https://github.com/colmap/pycolmap/releases/tag/v0.5.0), pycolmap can be installed on Windows too. However, it needs some testing before including in dependencies of deep-image-matching, as there are some errors on Windows that are blocking deep_image_matching pipeline (while it works completely fine on Linux).
3735

3836
### Notes and troubleshooting
3937

docs/micmac.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Usage with MICMAC
2+
3+
**Page under construction...**

docs/openmvg.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Use with OpenMVG
2+
3+
DIM can export matches in OpenMVG-compatible format and execute a comprehensive SfM reconstruction. All intermediate and final OpenMVG data are stored in the project folder specified with the `--dir` option, within the results folder for the current pipeline, under the openmvg subfolder.
4+
5+
To run OpenMVG processing pass to `--openmvg` option the configuration file that containes path to the binaries and run for instance:
6+
7+
```
8+
python ./main.py --dir ./assets/example_cyprus --pipeline superpoint+lightglue --openmvg ./config/openmvg_win.yaml
9+
```
10+
11+
An example of openmvg configuration file for windows:
12+
```
13+
general:
14+
path_to_binaries: path\to\OpenMVG\ReleaseV1.6.Halibut.WindowsBinaries_VS2017
15+
openmvg_database: path\to\ReleaseV1.6.Halibut.WindowsBinaries_VS2017\sensor_width_camera_database.txt
16+
```
17+
18+
An example of openmvg configuration file for linux:
19+
```
20+
general:
21+
path_to_binaries: null # If None, the binaries are assumed to be in the PATH
22+
openmvg_database: null # If None, it will be downloaded from the openMVG repository
23+
```
24+
25+
Camera model for openmvg can be specified in `config/cameras.yaml`:
26+
```
27+
general:
28+
camera_model: "pinhole" # ["simple-pinhole", "pinhole", "simple-radial", "opencv"]
29+
openmvg_camera_model: "pinhole_radial_k3" # ["pinhole", "pinhole_radial_k3", "pinhole_brown_t2"]
30+
single_camera: False
31+
```
32+
Cameras can be shared between all the images (`single_camera == True`), or each camera can have a different camera model (`single_camera == False`).

0 commit comments

Comments
 (0)