Compute the ground elevation based on one or multiple stereo pair(s)
Compute the ground elevation with a stereo block matching algorithm between one or multiple stereo pair in sensor geometry. The output is projected in desired geographic or cartographic map projection (WGS84 by default).
This application is chaining different processing steps. Some of them are also performed by other applications in the stereo-reconstruction framework:
* StereoRectificationGridGenerator  : for the generation of deformation grids
* GridBasedImageResampling  : resampling into epipolar geometry
* BlockMatching  : estimation of dense disparity maps
The pipeline executes the following steps on each stereo pair:
- compute the epipolar displacement grids from the stereo pair (direct and inverse)
- resample the stereo pair into epipolar geometry using BCO interpolation
- create masks for each epipolar image : remove black borders and resample input masks
- compute horizontal disparities with a block matching algorithm
- refine disparities to sub-pixel precision with a dichotomy algorithm
- apply an optional median filter
- filter disparities based on the correlation score and exploration bounds
- translate disparities in sensor geometry
- convert disparity to 3D Map.
Then all 3D maps are fused to produce DSM. The fusion method in each DEM cell can be chosen between maximum, minimum and average.
Input parameters (input): This group of parameters allows one to set input data.
Input images list (input.il): List of images corresponding to multiple views on a single scene, in sensor geometry.
Couples list (input.co): List of index of couples im image list. Couples must be separated by a comma (index start at 0). For example : 0 1,1 2 will process a first couple composed of the first and the second image in image list, then the second and the third image
. Note that images are handled by pairs. If left empty, couples are created from input index i.e. a first couple will be composed of the first and second image, a second couple with third and fourth image etc. (in this case image list must be even).
Input Image channel (input.channel): Channel used for block matching (the same for all images)
Elevation management (elev): This group of parameters allows managing elevation values. Supported formats are SRTM, DTED or any geotiff. DownloadSRTMTiles application could be a useful tool to list/download tiles related to a product.
DEM directory (elev.dem): This parameter allows selecting a directory containing Digital Elevation Model files. Note that this directory should contain only DEM files. Unexpected behaviour might occurs if other images are found in this directory.
Geoid File (elev.geoid): Use a geoid grid to get the height above the ellipsoid in case there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles. A version of the geoid can be found on the OTB website(https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/blob/master/Input/DEM/egm96.grd).
Default elevation (elev.default): This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value.
Output parameters (output): This group of parameters allows one to choose the DSM resolution, nodata value, and projection parameters.
Output resolution (output.res): Spatial sampling distance of the output elevation : the cell size (in m)
NoData value (output.nodata): DSM empty cells are filled with this value (optional -32768 by default)
Method to fuse measures in each DSM cell (output.fusionmethod): This parameter allows one to choose the method used to fuse elevation measurements in each output DSM cell
Maximum (max): The cell is filled with the maximum measured elevation values
Minimum (min): The cell is filled with the minimum measured elevation values
Mean (mean): The cell is filled with the mean of measured elevation values
Accumulator (acc): Accumulator mode. The cell is filled with the the number of values (for debugging purposes).
Output DSM (output.out): Output elevation image
Parameters estimation modes (output.mode):
Fit to sensor image (fit): Fit the size, origin and spacing to an existing ortho image (uses the value of outputs.ortho)
User Defined (user): This mode allows you to fully modify default values.
Upper Left X (output.mode.user.ulx): Cartographic X coordinate of upper-left corner (meters for cartographic projections, degrees for geographic ones)
Upper Left Y (output.mode.user.uly): Cartographic Y coordinate of the upper-left corner (meters for cartographic projections, degrees for geographic ones)
Size X (output.mode.user.sizex): Size of projected image along X (in pixels)
Size Y (output.mode.user.sizey): Size of projected image along Y (in pixels)
Pixel Size X (output.mode.user.spacingx): Size of each pixel along X axis (meters for cartographic projections, degrees for geographic ones)
Pixel Size Y (output.mode.user.spacingy): Size of each pixel along Y axis (meters for cartographic projections, degrees for geographic ones)
Map Projection (map): Defines the map projection to be used.
Universal Trans-Mercator (UTM) (utm): A system of transverse mercator projections dividing the surface of Earth between 80S and 84N latitude.
Zone number (map.utm.zone): The zone number ranges from 1 to 60 and allows defining the transverse mercator projection (along with the hemisphere)
Northern Hemisphere (map.utm.northhem): The transverse mercator projections are defined by their zone number as well as the hemisphere. Activate this parameter if your image is in the northern hemisphere.
Lambert II Etendu (lambert2): This is a Lambert Conformal Conic projection mainly used in France.
Lambert93 (lambert93): This is a Lambert 93 projection mainly used in France.
WGS 84 (wgs): This is a Geographical projection
EPSG Code (epsg): This code is a generic way of identifying map projections, and allows specifying a large amount of them. See www.spatialreference.org to find which EPSG code is associated to your projection;
EPSG Code (map.epsg.code): See www.spatialreference.org to find which EPSG code is associated to your projection
Stereorectification Grid parameters (stereorect): This group of parameters allows one to choose direct and inverse grid subsampling. These parameters are very useful to tune time and memory consumption.
Step of the displacement grid (in pixels) (stereorect.fwdgridstep): Stereo-rectification displacement grid only varies slowly. Therefore, it is recommended to use a coarser grid (higher step value) in case of large images
Sub-sampling rate for epipolar grid inversion (stereorect.invgridssrate): Grid inversion is an heavy process that implies spline regression on control points. To avoid eating to much memory, this parameter allows one to first sub-sample the field to invert.
Block matching parameters (bm): This group of parameters allow tuning the block-matching behavior
Block-matching metric (bm.metric): Metric used to compute matching score
Sum of Squared Distances divided by mean of block (ssdmean): derived version of Sum of Squared Distances between pixels value in the metric window (SSD divided by mean over window)
Sum of Squared Distances (ssd): Sum of squared distances between pixels value in the metric window
Normalized Cross-Correlation (ncc): Normalized Cross-Correlation between the left and right windows
Lp pseudo-norm (lp): Lp pseudo-norm between the left and right windows
p value (bm.metric.lp.p): Value of the p parameter in Lp pseudo-norm (must be positive)
Correlation window radius (in pixels) (bm.radius): The radius of blocks in Block-Matching (in pixels)
Minimum altitude offset (in meters) (bm.minhoffset): Minimum altitude below the selected elevation source (in meters)
Maximum altitude offset (in meters) (bm.maxhoffset): Maximum altitude above the selected elevation source (in meters)
Postprocessing parameters (postproc): This group of parameters allow use optional filters.
Use bijection consistency in block matching strategy (postproc.bij): Use bijection consistency. Right to Left correlation is computed to validate Left to Right disparities. If bijection is not found, the disparity is rejected.
Use median disparities filtering (postproc.med): Disparity map can be filtered using median post filtering (disabled by default).
Correlation metric threshold (postproc.metrict): Use block matching metric output to discard pixels with low correlation value (disabled by default, float value)
Input left mask (mask.left): Mask for left input image. Pixel with a null mask value are discarded.
Input right mask (mask.right): Mask for right input image. Pixel with a null mask value are discarded.
Discard pixels with low local variance (mask.variancet): This parameter allows one to discard pixels whose local variance is too small (the size of the neighborhood is given by the correlation window radius)
Available RAM (Mb) (ram): Available memory for processing (in MB)
Load otb application from xml file (inxml): Load otb application from xml file
Save otb application to xml file (outxml): Save otb application to xml file
Example of use
input.il: sensor_stereo_left.tif sensor_stereo_right.tif
otbcli_StereoFramework -input.il sensor_stereo_left.tif sensor_stereo_right.tif -elev.default 200 -stereorect.fwdgridstep 8 -stereorect.invgridssrate 4 -postproc.med 1 -output.res 2.5 -output.out dem.tif