3.6.4 From disparity to Digital Surface Model

Using the previous application, we evaluated disparities between images. The next (and last!) step is now to transform the disparity map into an elevation information to produce an elevation map. It uses as input the disparity maps (horizontal and vertical) to produce a Digital Surface Model (DSM) with a regular sampling. The elevation values is computed from the triangulation of the ”left-right” pairs of matched pixels. When several elevations are available on a DSM cell, the highest one is kept.

First, an important point is that it is often a good idea to rework the disparity map given by the BlockMatching application to only keep relevant disparities. For this purpose, we can use the output optimal metric image and filter disparities with respect to this value.

For example, if we used Normalized Cross-Correlation (NCC), we can keep only disparities where optimal metric value is superior to 0.9. Disparities below this value can be consider as inaccurate and will not be used to compute elevation information (the -io.mask parameter can be used for this purpose).

This filtering can be easily done with OTB Applications.

We first use the BandMath application to filter disparities according to their optimal metric value:

otbcli_BandMath -il disparity_map_ncc.tif  
                -out thres_hdisparity.tif uint8  
                -exp "if(im1b3>0.9,255,0)"

Then, we concatenate thresholded disparities using the ConcatenateImages:

otbcli_ConcatenateImages -il thres_hdisparity.tif thres_vdisparity.tif  
                         -out thres_hvdisparity.tif

Now, we can use the DisparityMapToElevationMap application to compute the elevation map from the filtered disparity maps.

otbcli_DisparityMapToElevationMap -io.in disparity_map_ncc.tif  
                                  -io.left image1.tif  
                                  -io.right image2.tif  
                                  -io.lgrid outimage1_pyramid.tif  
                                  -io.rgrid outimage2_pyramid.tif  
                                  -io.mask thres_hdisparity.tif  
                                  -io.out disparity_map_ssd_to_elevation.tif  
                                  -hmin 10  
                                  -hmax 400  
                                  -elev.default 50

It produces the elevation map projected in WGS84 (EPSG code:4326) over the ground area covered by the stereo pair. Pixels values are expressed in meters.


PIC

Figure 3.24: Extract of the elevation map over Pyramids of Cheops.


This is it ! Figure 3.24 shows the output DEM from the Cheops pair.