Skip to content

Commit 1559cf0

Browse files
committed
Update doc building instructions
1 parent 07cf5fb commit 1559cf0

File tree

8 files changed

+57
-40
lines changed

8 files changed

+57
-40
lines changed

doc/source/annotation_tool.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Main toolbox
4949
~~~~~~~~~~~~
5050

5151
The main toolbox contains the list of existing control points as well as several controls.
52-
The basic controls are explained here. Scroll to :ref:`additional-controls` for information on the rest.
52+
The basic controls are explained here. Scroll to :ref:`advanced-features` for information on the rest.
5353

54-
- The 'Load', 'Save' buttons save and load the ground control points into a ``ground_control_points.json`` file with :ref:`json-gcps`.
54+
- The 'Load', 'Save' buttons save and load the ground control points into a ``ground_control_points.json`` file (see the JSON file format section in the Ground Control Points documentation).
5555
- If there is a ``ground_control_points.json`` file in the dataset directory, it will be loaded upon launch.
5656
- Control points can be added or removed with the 'Add GCP' and 'Remove GCP' buttons. The active point can be selected from the dropdown.
5757
- By selecting a point in the list it becomes active and can be annotated on all images.
@@ -84,6 +84,7 @@ Assuming that you have a set of ground control points whose geodetic coordinates
8484
You can use ``data/berlin`` for this example.
8585
2. Generate a ``ground_control_points.json`` file with all your measured ground control points and place it in the root of the dataset
8686
See the example below. Note how the 'observations' is empty as we will generate those using the annotation tool.
87+
8788
::
8889

8990
"points": [
@@ -93,6 +94,7 @@ Assuming that you have a set of ground control points whose geodetic coordinates
9394
"observations": []
9495
}
9596
]
97+
9698
3. Launch the annotation tool, note how the control points dropdown contains your ground control points.
9799
4. Scroll through all the images, annotating each GCP on all the locations where it is visible.
98100
5. Click on 'save' to overwrite the ``ground_control_points.json`` file with your annotations.
@@ -122,6 +124,8 @@ The 'Flex' and 'Full' buttons produce additional analysis results and
122124
are explained in :ref:`two-reconstruction-annotation`
123125

124126

127+
.. _advanced-features:
128+
125129
Advanced features
126130
-----------------
127131

doc/source/building.rst

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ Building
66

77
Quick start
88
-----------
9+
910
To build OpenSfM, follow these steps:
1011

11-
1. Download the OpenSfM code from Github
12+
1. Download the OpenSfM code from Github::
1213

1314
git clone --recursive https://github.com/mapillary/OpenSfM
1415

15-
2. Install the dependencies (we recommend using conda)
16+
2. Install the dependencies (we recommend using conda)::
1617

1718
conda env create --file conda.yml --yes
1819
conda activate opensfm
1920

20-
3. Build OpenSfM
21+
3. Build OpenSfM::
2122

2223
pip install -e .
2324

@@ -45,7 +46,7 @@ The way to install these dependencies depends on your system. We recommend using
4546
Installing dependencies using Conda (recommended)
4647
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4748

48-
Creating a conda environment will take care of installing all dependencies. Make sure you have conda or miniconda installed. From the project root directory, run::
49+
Creating a conda environment will take care of installing all dependencies. Make sure you have conda or miniconda installed. From the project root directory, run::
4950

5051
conda env create --file conda.yml --yes
5152

@@ -58,19 +59,19 @@ and you are ready to build OpenSfM.
5859
(Anaconda dependencies installation has been tested under MacOS (Sequoia), Ubuntu 24.04 and Fedora 42.)
5960

6061
Installing dependencies on Ubuntu
61-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6263

6364
If you are not using conda, see this `Dockerfile.ubuntu24 <https://github.com/mapillary/OpenSfM/blob/main/Dockerfile.ubuntu24>`_ for the commands to install all dependencies on Ubuntu 24.04.
6465

6566

6667
Installing dependencies on MacOSX
67-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6869

6970
While it is possible to install all dependencies using brew, we recommend using the conda instructions above instead.
7071

7172

7273
Installing dependencies on Windows
73-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7475

7576
Install git_.
7677

@@ -101,23 +102,37 @@ Once the dependencies have been installed, you can build OpenSfM by running the
101102

102103
This will first install python dependencies on your current python environment, and then build OpenSfM and install it in editable mode.
103104

105+
104106
Building Docker images
105107
----------------------
106108

107-
You can also use OpenSfM inside docker. We provide example Dockerfiles for Ubuntu 20.04 and 24.04. Build it by running the following command from the main folder::
109+
You can also use OpenSfM inside docker. We provide example Dockerfiles for Ubuntu 20.04 and 24.04. Build it by running the following command from the main folder::
108110

109111
docker build -t opensfm.ubuntu24 -f Dockerfile.ubuntu24 .
110112

113+
111114
Building the documentation
112115
--------------------------
113-
To build the documentation and browse it locally use::
114116

115-
pip install sphinx_rtd_theme
116-
python setup.py build_doc
117-
python -m http.server --directory build/doc/html/
117+
To build the documentation and browse it locally, first install Sphinx::
118+
119+
pip install -e .[docs]
120+
121+
Then build the documentation using make::
122+
123+
cd doc
124+
make html
125+
126+
To browse the documentation locally::
127+
128+
make serve
118129

119130
and browse `http://localhost:8000/ <http://localhost:8000/>`_
120131

132+
To clean the build artifacts::
133+
134+
make clean
135+
121136

122137
.. _Github: https://github.com/mapillary/OpenSfM
123138
.. _release: https://github.com/mapillary/OpenSfM/releases

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# General information about the project.
5252
project = "OpenSfM"
53-
copyright = "2021, Mapillary"
53+
copyright = "2025, Mapillary"
5454
author = "Mapillary"
5555

5656
# The version info for the project you're documenting, acts as replacement for
@@ -67,7 +67,7 @@
6767
#
6868
# This is also used if you do content translation via gettext catalogs.
6969
# Usually you set "language" from the command line for these cases.
70-
language = None
70+
language = "en"
7171

7272
# There are two options for replacing |today|: either, you set today to some
7373
# non-false value, then it is used:

doc/source/gcp.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ In the bundle adjustment step, GCP observations are used as a constraint to refi
1212

1313
GPSs can be specified in two file formats. If existing, both are loaded.
1414

15-
.. _json-gcps:
16-
1715
JSON file format
1816
~~~~~~~~~~~~~~~~
1917
GCPs can be specified by adding a text file named ``ground_control_points.json`` at the root folder of the dataset. The format of the file should be as follows::

doc/source/quality_report.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ Reconstruction Details
5252

5353
|rec|
5454

55-
- Average reprojection error (normalized/pixels): normalized (by features uncertainty) average norm of reprojection errors and same, but pixel-wise,
56-
un-normalized, error. Errors bigger than 4 pixels are pruned out.
57-
- Average Track Length : average number of images in which a reconstructed points has been detected.
58-
- Average Track Length (> 2) : same as above but ignoring 2-images points.
55+
- Average reprojection error (normalized/pixels): normalized (by features uncertainty) average norm of reprojection errors and same, but pixel-wise,
56+
un-normalized, error. Errors bigger than 4 pixels are pruned out.
57+
- Average Track Length : average number of images in which a reconstructed points has been detected.
58+
- Average Track Length (> 2) : same as above but ignoring 2-images points.
5959

60-
|residual_histogram|
60+
|residual_histogram|
6161

6262
The tables are the histogram of the certainty-normalized and un-normalized reprojection errors norm. Errors bigger than 4 pixels are pruned out.
6363

doc/source/rig.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ Coordinate Systems
1212
Rig are defined by a fixed assembly of cameras that are triggered at the same instant.
1313
The following terms define such assembly and capture in OpenSfM terminology :
1414

15-
- A `RigCamera` is a camera of the rig assembly defined as a combination of an existing camera model (it refers only to its ID) and its pose wrt. the rig assembly coordinate frame. `RigCamera` are defined in the `rig_cameras.json` as the following::
15+
- A `RigCamera` is a camera of the rig assembly defined as a combination of an existing camera model (it refers only to its ID) and its pose wrt. the rig assembly coordinate frame. `RigCamera` are defined in the `rig_cameras.json` as the following::
1616

17-
{
18-
"RIG_CAMERA_ID":
1917
{
20-
"translation": translation of the rig frame wrt. the RigCamera frame
21-
"rotation": rotation bringing a point from rig frame to the RigCamera frame
22-
"camera": camera model ID of this RigCamera
23-
},
24-
...
18+
"RIG_CAMERA_ID":
19+
{
20+
"translation": translation of the rig frame wrt. the RigCamera frame
21+
"rotation": rotation bringing a point from rig frame to the RigCamera frame
22+
"camera": camera model ID of this RigCamera
23+
},
24+
...
25+
}
2526

26-
- A `RigInstance` is a list of `Shots`, each of which correspond to a `RigCamera` of the `RigModel` and the actual pose of the `RigModel` in the world : it's indeed an instantiation of the `RigModel` by combining `Shots`. These instances are defined in the `rig_assignments.json` file as follows::
27+
- A `RigInstance` is a list of `Shots`, each of which correspond to a `RigCamera` of the `RigModel` and the actual pose of the `RigModel` in the world : it's indeed an instantiation of the `RigModel` by combining `Shots`. These instances are defined in the `rig_assignments.json` file as follows::
2728

2829
{
2930
"RIG_INSTANCE_ID1": {
@@ -57,8 +58,7 @@ The following terms define such assembly and capture in OpenSfM terminology :
5758
]
5859
},
5960
...
60-
61-
61+
}
6262

6363
A picture is often worth many words :
6464
|rig_frame|

doc/source/sensor_database.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Calibration Database
99
Overview
1010
--------
1111

12-
In order to produce accurate geometry, structure-from-motion (SfM) needs to have correct estimates of the imaging sensor geometry, such as : lens type (fisheye, perspective, spherical), focal, distorsion, principal point. Please refer to the `Geometric Models`_ section for a comprehensive list of camera internal parameters (calibration).
12+
In order to produce accurate geometry, structure-from-motion (SfM) needs to have correct estimates of the imaging sensor geometry, such as : lens type (fisheye, perspective, spherical), focal, distorsion, principal point. Please refer to the :doc:`geometry` section for a comprehensive list of camera internal parameters (calibration).
1313

1414
While reconstructing the scene (using incremental SfM), OpenSfM will adjust for the camera calibration values that best explain the seen geometry. However, in order to get optimal and failsafe results, it is recommended to have a first good guess of the calibration values. By default, OpenSfM will try to get these values by reading the image EXIFs, where the focal length can be red, and is one of the most important of the calibration values. However, sometimes, EXIFs does not contain such value, or it is erroneous, and/or it is better to have other values than just the focal length.
1515

@@ -21,18 +21,18 @@ Here comes sensors databases to the rescue. These are files stored under ``opens
2121
sensor_data_detailed.json
2222
-------------------------
2323

24-
This file contains physical sensor's width and height, in millimeters, for a given ``model make`` sensor (see `extract_metadata`_). It means that if only the focal length is available in the EXIFs, since we also have the sensor physical size, we know the full sensor geometry.
24+
This file contains physical sensor's width and height, in millimeters, for a given ``model make`` sensor (see ``extract_metadata`` command). It means that if only the focal length is available in the EXIFs, since we also have the sensor physical size, we know the full sensor geometry.
2525

2626

2727
sensor_data.json
2828
----------------
2929

30-
This file contains a multiplicative factor for a given ``model make`` sensor (see `extract_metadata`_). When applied to the EXIFs focal length, this factor gives the focal 35mm equivalent. Since we know the dimensions of 35mm equivalent (24x32 mm), we again know the full sensor geometry.
30+
This file contains a multiplicative factor for a given ``model make`` sensor (see ``extract_metadata`` command). When applied to the EXIFs focal length, this factor gives the focal 35mm equivalent. Since we know the dimensions of 35mm equivalent (24x32 mm), we again know the full sensor geometry.
3131

3232
camera_calibration.json
3333
------------------------
3434

35-
This file contains the full definition (in OpenSfM format) of camera calibrations. Calibration are for a given ``make`` (see `extract_metadata`_), and then, they're further refined :
35+
This file contains the full definition (in OpenSfM format) of camera calibrations. Calibration are for a given ``make`` (see ``extract_metadata`` command), and then, they're further refined :
3636
- If ``ALL`` is specified, then the calibration is valid for all ``make model`` camera independant of their ``model`` value
3737
- If ``MODEL`` is specified, then calibrations are per actual ``model``
3838
- If ``FOCAL`` is specified, then calibrations are per focal length red from the EXIFs

doc/source/using.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ First, build the OpenSfM Docker image, as described under "building".
2222

2323
Then, start a Docker container. The following command mounts the `data/` folder to `/data/` inside the Docker container::
2424

25-
docker run -it -p 8080:8080 -v ${PWD}/data/:/data/ opensfm:ceres2
25+
docker run -it -p 8080:8080 -v ${PWD}/data/:/data/ opensfm.ubuntu24 /bin/bash
2626

2727
Once inside the running Docker container, start the reconstruction process with the usual command::
2828

@@ -316,4 +316,4 @@ Checkout `the default configuration <_modules/opensfm/config.html>`_ to see the
316316

317317

318318
.. include:: gcp.rst
319-
.. _fisheye https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html
319+
.. _fisheye: https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html

0 commit comments

Comments
 (0)