Skip to content

Commit 873da2b

Browse files
committed
Merge branch 'docs-readthedocs-review' into 'master'
docs: readthedocs review See merge request 3d/cars-park/cars!784
2 parents 05189ea + ca665f1 commit 873da2b

11 files changed

+245
-75
lines changed

AUTHORS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This file keeps track of authors contributions.
1313
## Development Lead
1414

1515
* David Youssefi <[email protected]>
16-
* Emmanuel Dubois <emmanuel.dubois@cnes.fr>
16+
* Valentine Bellet <valentine.bellet@cnes.fr>
1717
* Yoann Steux <[email protected]>
1818
* Mathis Roux <[email protected]>
1919
* Cedric Traizet <[email protected]>
@@ -22,6 +22,7 @@ This file keeps track of authors contributions.
2222

2323
* Julien Michel <[email protected]>
2424
* Emmanuelle Sarrazin <[email protected]>
25+
* Emmanuel Dubois <[email protected]>
2526
* Aurélie Emilien <[email protected]>
2627
* Florian Douziech <[email protected]>
2728
* Loïc Dumas <[email protected]>

docs/source/exploring_the_field/from_satellite_images_to_dsm.rst

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ Generate a DSM step by step
2525
:target: index.html#rasterization
2626

2727
.. |rasterization_circled| image:: ../images/dense.rasterization.circled.drawio.png
28-
28+
29+
.. |matching_spa| image:: ../images/sparse.matching.drawio.png
30+
:target: index.html#matchingsparse
31+
32+
.. |matching_spa_circled| image:: ../images/sparse.matching.circled.drawio.png
33+
34+
.. |triangulation_spa| image:: ../images/sparse.triangulation.drawio.png
35+
:target: index.html#triangulationsparse
36+
37+
.. |triangulation_spa_circled| image:: ../images/sparse.triangulation.circled.drawio.png
38+
39+
.. |rasterization_spa| image:: ../images/sparse.rasterization.drawio.png
40+
:target: index.html#rasterizationsparse
41+
42+
.. |rasterization_spa_circled| image:: ../images/sparse.rasterization.circled.drawio.png
43+
2944
.. |resampling_image| image:: ../images/crop_image10.gif
3045

31-
.. |matching_image| image:: ../images/crop_image13.png
46+
.. |matching_image| image:: ../images/crop_image13.drawio.png
3247

3348
.. |matching_spa_image| image:: ../images/sift.png
3449

35-
.. |triangulation_image| image:: ../images/point_cloud_as_image.png
50+
.. |triangulation_image| image:: ../images/point_cloud_as_image.drawio.png
3651

3752
.. |triangulation_spa_image| image:: ../images/image27.png
3853

@@ -109,12 +124,14 @@ To obtain a raster image, the final process projects each point into a 2D grid:
109124
+------------------------------+---------------------------------------------+
110125

111126
Initial Input Digital Elevation Model
112-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127+
-------------------------------------
113128

114-
For now, CARS can use an initial input Digital Elevation Model (:term:`DEM`) which is integrated in the stereo-rectification to minimize the disparity intervals to explore.
115-
Any geotiff file can be used.
129+
The user can provide as input a low resolution Digital Elevation Model (:term:`DEM`). It helps to minimize the disparity intervals to explore. Any geotiff file can be used.
130+
If the DEM is not specified by the user, an internal DEM is generated with sparse matches.
116131

117-
The parameter is ``initial_elevation`` as seen in :ref:`configuration`.
132+
To download the low resolution DEM corresponding to your area, see section :ref:`download_srtm_tiles`.
133+
134+
The parameter is ``dem`` in ``initial_elevation`` as seen in :ref:`configuration`.
118135

119136

120137
Altimetric exploration and geometric inaccuracies
@@ -123,3 +140,43 @@ Altimetric exploration and geometric inaccuracies
123140
To reduce the search interval (i.e. altimetric exploration) in the matching step and thus save computing time, a faster sparse matching step is typically used. This matching step also enables geometric errors to be corrected, thus ensuring that the epipolar geometry (based on these models) is correct.
124141

125142
Matching can be performed with keypoints like `SIFT <https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf>`_.
143+
144+
.. _matchingsparse:
145+
146+
+-----------------------------+---------------------------------------------+
147+
| Pipeline | Matching (sparse) |
148+
+-----------------------------+---------------------------------------------+
149+
| |images_models| |br| | |matching_spa_image| |
150+
| |resampling| |br| | |
151+
| |matching_spa_circled| |br| | |
152+
| |triangulation_spa| |br| | |
153+
| |rasterization_spa| |br| | |
154+
+-----------------------------+---------------------------------------------+
155+
156+
The result is a sparse point cloud...
157+
158+
.. _triangulationsparse:
159+
160+
+----------------------------------+---------------------------------------------+
161+
| Pipeline | Triangulation (sparse) |
162+
+----------------------------------+---------------------------------------------+
163+
| |images_models| |br| | |triangulation_spa_image| |
164+
| |resampling| |br| | |
165+
| |matching_spa| |br| | |
166+
| |triangulation_spa_circled| |br| | |
167+
| |rasterization_spa| |br| | |
168+
+----------------------------------+---------------------------------------------+
169+
170+
and a sparse digital surface model.
171+
172+
.. _rasterizationsparse:
173+
174+
+----------------------------------+---------------------------------------------+
175+
| Pipeline | Rasterization (sparse) |
176+
+----------------------------------+---------------------------------------------+
177+
| |images_models| |br| | |rasterization_spa_image| |
178+
| |resampling| |br| | |
179+
| |matching_spa| |br| | |
180+
| |triangulation_spa| |br| | |
181+
| |rasterization_spa_circled| |br| | |
182+
+----------------------------------+---------------------------------------------+

docs/source/exploring_the_field/masks_and_classifications_usage.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Mask and Classification Usage
22
=============================
33

4-
| Photogrammetry is a technique that cannot reproduce altitude on water. This technique also has difficulties for moving elements or in shaded areas.
4+
| Photogrammetry is a technique that cannot reproduce altitude on water. This technique also has difficulties for shaded areas, cloudy areas or moving elements such as cars.
55
| For this reason, it is possible to mask out areas or apply ad hoc processing to aid the matching stage.
66
7-
Masks
7+
8+
Mask
89
-----
910

1011
| CARS can use a mask for each image in order to ignore some image regions (for instance water mask). This mask is taken into account during the whole 3D restitution process.

docs/source/howto.rst

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ Get full stereo products
1010
========================
1111

1212

13-
Dinamis
14-
-------
13+
Pléiades / SPOT 6-7 products (DINAMIS)
14+
--------------------------------------
1515

16-
| DINAMIS is a platform that acquires and distributes satellite Earth imagery for french and foreign institutional users under `specific subscription conditions <https://dinamis.data-terra.org/en/eligible-users/>`_.
17-
| Please visit the dinamis website for more information: https://dinamis.data-terra.org/.
16+
| `DINAMIS <https://dinamis.data-terra.org/catalogue/>`_ is a platform that acquires and distributes satellite Earth imagery (Pléaides and Spot 6-7) for french and foreign institutional users under `specific subscription conditions <https://dinamis.data-terra.org/en/eligible-users/>`_.
1817
1918

2019
AIRBUS Pleiades NEO example files
@@ -68,17 +67,35 @@ Make input ROI images
6867
-bbx x1 y1 x2 y2 Bounding box from two points (x1, y1) and (x2, y2)
6968
7069
70+
71+
How to find the coordinates of the bounding box ?
72+
.................................................
7173

72-
For example, if you have downloaded the maxar example data :ref:`maxar_example_files`, you can choose a region of interest with `geojson.io <https://geojson.io/#map=16.43/-34.490433/-58.586864>`_.
74+
For example, if you have downloaded the maxar example data :ref:`maxar_example_files`, you are working in an area near to San Fernando in Argentina. Go to the website `geojson.io <https://geojson.io/>`_ in order to select your ROI:
7375

74-
And then extract region, create config file and launch cars:
76+
.. |roisanfernando| image:: images/roi_san_fernando_argentina.jpg
77+
:width: 60%
78+
79+
|roisanfernando|
80+
81+
You can either select the upper left corner with the lower right corner (in red in the previous image):
7582

7683
.. code-block:: console
7784
78-
cars-extractroi -il *.NTF -out ext_dir -bbx -58.5896 -34.4872 -58.5818 -34.4943
85+
cars-extractroi -il *.NTF -out ext_dir -bbx -58.5809 -34.4934 -58.5942 -34.4869
7986
cars-starter -il ext_dir/*.tif -out out_dir > config.json
8087
cars config.json
8188
89+
or the lower left corner with the upper right corner (in purple in the previous image):
90+
91+
.. code-block:: console
92+
93+
cars-extractroi -il *.NTF -out ext_dir -bbx -58.5809 -34.4869 -58.5942 -34.4934
94+
cars-starter -il ext_dir/*.tif -out out_dir > config.json
95+
cars config.json
96+
97+
98+
N.B.: Instead of using ``cars-extractroi``, you can directly give the GeoJson dictionnary in the configuration file (Please, see :ref:`configuration` for details). In this case, the sparse steps (geometric corrections) are processed on the entire image and not only on the ROI.
8299

83100
Monitor tiles progression
84101
-------------------------
@@ -149,6 +166,8 @@ The low NDWI values can be considered as water area.
149166
.. code-block:: console
150167
151168
gdal_calc.py -G input.tif --G_band=2 -N input.tif --N_band=4 --outfile=mask.tif --calc="((1.0*G-1.0*N)/(1.0*G+1.0*N))>0.3" --NoDataValue=0
169+
170+
It is also possible to produce a water mask with `SLURP <https://github.com/CNES/slurp>`_.
152171

153172
See next section to apply a gdal_translate to convert the mask with 1bit image struture.
154173

@@ -168,7 +187,7 @@ To translate single image or multiband image with several nbits per band to 1bit
168187
Add band name / description in TIF files metadata
169188
--------------------------------------------------
170189

171-
To add a band name / description in TIF files, for classification or color files in order to be used:
190+
To add a band name / description ("water", "cloud", etc.) in TIF files, for classification or color files in order to be used:
172191

173192

174193
.. code-block:: python
@@ -178,6 +197,49 @@ To add a band name / description in TIF files, for classification or color files
178197
band_in.SetDescription(band_description)
179198
data_in = None
180199
200+
.. _download_srtm_tiles:
201+
202+
Get low resolution DEM
203+
========================
204+
205+
SRTM 90m DEM
206+
---------------
207+
208+
It is possible to download a low resolution DEM (90-m SRTM) corresponding to your area. To get a SRTM tile, you need to run the following python script knowing the latitude and the longitude of your area:
209+
210+
.. code-block:: python
211+
212+
import numpy as np
213+
214+
def get_srtm_tif_name(lat, lon):
215+
"""Download srtm tiles"""
216+
# longitude: [1, 72] == [-180, +180]
217+
tlon = (1+np.floor((lon+180)/5)) % 72
218+
tlon = 72 if tlon == 0 else tlon
219+
220+
# latitude: [1, 24] == [60, -60]
221+
tlat = 1+np.floor((60-lat)/5)
222+
tlat = 24 if tlat == 25 else tlat
223+
224+
srtm = "https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_%02d_%02d.zip" % (tlon, tlat)
225+
return srtm
226+
227+
if __name__ == "__main__":
228+
print("Get SRTM tile corresponding to latitude and longitude couple")
229+
while 1:
230+
print(">> Latitude? ", end="")
231+
lat = input()
232+
print(">> Longitude? ", end="")
233+
lon = input()
234+
print(">> SRTM filename:", get_srtm_tif_name(int(lat), int(lon)))
235+
input()
236+
237+
238+
If your area intersects multiple latitudes and longitudes, get all the SRTM tiles and create a VRT from them:
239+
240+
.. code-block:: console
241+
242+
gdalbuildvrt srtm.vrt srtm_tile1.tif srtm_tile2.tif
181243
182244
Post process output
183245
===================
1.61 MB
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)