Disparity map to elevation map
Brief Description
Projects a disparity map into a regular elevation map.
Tags
Stereo
Long Description
This application uses a disparity map computed from a stereo image pair to produce an elevation map on the ground area covered by the stereo pair.
This application is part of the stereo reconstruction pipeline. It can be used after having computed the disparity map with BlockMatching.
The needed inputs are : the disparity map, the stereo pair (in original geometry) and the epipolar deformation grids. These grids (computed by StereoRectificationGridGenerator) have to contain the transform between the original geometry (stereo pair) and the epipolar geometry (disparity map). The algorithm for each disparity is the following :
* skip if position is discarded by the disparity mask
* compute left ray : transform the current position from epipolar geometry to left sensor geometry (left rectification grid)
* compute right ray : shift the current position with current disparity and transform from epipolar geometry to right sensor (right rectification grid)
* estimate best 3D intersection between left and right rays
* for the ground cell of the obtained 3D point, keep its elevation if greater than current elevation (keeps the maximum of elevations of all 3D points in each cell)
Minimum and maximum elevations settings are here to bound the reconstructed DEM.
Parameters
Input and output data (io): This group of parameters allows one to set input images, output images and grids.
Input disparity map (io.in): The input disparity map (horizontal disparity in first band, vertical in second). This map can be computed by BlockMatching application.
Left sensor image (io.left): Left image in original (sensor) geometry. Only the geometric model of this image will be used, not the pixel values.
Right sensor image (io.right): Right image in original (sensor) geometry. Only the geometric model of this image will be used, not the pixel values.
Left Grid (io.lgrid): Left epipolar grid (deformation grid between left sensor et disparity spaces)
Right Grid (io.rgrid): Right epipolar grid (deformation grid between right sensor et disparity spaces)
Output elevation map (io.out): Output elevation map in ground projection. Elevation values are in meters. Floating point pixel type are expected.
Disparity mask (io.mask): Masked disparity pixels won't be projected (mask values equal to zero)
DEM step (step): Spacing of the output elevation map (in meters)
Minimum elevation expected (hmin): Minimum elevation expected (in meters)
Maximum elevation expected (hmax): Maximum elevation expected (in meters)
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.
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
Limitations
The epipolar deformation grid should be able to entirely fit in memory.
Authors
OTB-Team
See also
[1] StereoRectificationGridGenerator
[2] BlockMatching
Example of use
io.in: disparity.tif
io.left: sensor_left.tif
io.right: sensor_right.tif
io.lgrid: grid_epi_left.tif
io.rgrid: grid_epi_right.tif
io.out: dem.tif
otbcli_DisparityMapToElevationMap -io.in disparity.tif -io.left sensor_left.tif -io.right sensor_right.tif -io.lgrid grid_epi_left.tif -io.rgrid grid_epi_right.tif -io.out dem.tif