I feel like I’m so close to nailing the whole process having gone through every step individually and tested many permutations.
However I have 2 remaining issues to resolve and wonder if anyone has experience fine tuning the output with this process to get a quality elevation map. First is how to clear up the noise within the output raster, and the other is related to preventing the steep drop off at the shoreline - see all the steps listed and example of the issue on screen caps at the bottom:
Extract ROI:
Left Image:
otbcli_ExtractROI \
-in D:/stereo/16JUN18143623-P1BS-057461431010_01_P001.TIF \
-out D:/14_10_19/stereo_test_2_small_L.tif uint16
-startx -5.16675
-starty 57.90735
-sizex 8192
-sizey 8192
Having extracted Left I then used the ‘fit’ feature of ExtractROI process to get the Right image:
otbcli_ExtractROI \
-in D:/stereo/16JUN18143537-P1BS-057461431010_01_P001.TIF
-out D:/14_10_19/stereo_test_1_small_R.tif float
-mode fit
-mode.fit.im D:/14_10_19/stereo_test_2_small_L.tif
-ram 128
Stereo Rectification Grid Generator:
otbcli_StereoRectificationGridGenerator
-io.inleft D:/14_10_19/stereo_test_2_small_L.tif
-io.inright D:/14_10_19/stereo_test_1_small_R.tif
-epi.elevation.dem D:/dem/opentopo
-io.outleft D:/14_10_19/31_grid_stereo_test_2_small_L.tif
-io.outright D:/14_10_19/31_grid_stereo_test_1_small_R.tif
Left Image:
otbcli_GridBasedImageResampling
-io.in D:/14_10_19/stereo_test_2_small_L.tif
-io.out D:/14_10_19/31_epi_stereo_test_2_small_L.tif
-grid.in D:/14_10_19/31_grid_stereo_test_2_small_L.tif
-out.sizex 10220
-out.sizey 10220
Right Image:
otbcli_GridBasedImageResampling -io.in D:/14_10_19/stereo_test_1_small_R2.tif -io.out D:/14_10_19/31_epi_stereo_test_1_small_R.tif
-grid.in D:/14_10_19/31_grid_stereo_test_1_small_R.tif
-out.sizex 10220
-out.sizey 10220
otbcli_BlockMatching
-io.inleft D:/14_10_19/31_epi_stereo_test_2_small_L.tif
-io.inright D:/14_10_19/31_epi_stereo_test_1_small_R.tif
-io.out D:/14_10_19/31_disparity_map_3_1.tif
-bm.minhd -279
-bm.maxhd -75
-bm.minvd -1
-bm.maxvd 1
-mask.nodata 0
-mask.variancet 50
-io.outmetric 1
-bm.metric ncc
-bm.medianfilter.radius 10
-bm.medianfilter.incoherence 2.0
Disparity Map To Elevation Map:
otbcli_DisparityMapToElevationMap
-io.in D:/14_10_19/31_disparity_map_3_1.tif
-io.left D:/14_10_19/stereo_test_2_small_L.tif
-io.right D:/14_10_19/stereo_test_1_small_R.tif
-io.lgrid D:/14_10_19/31_grid_stereo_test_2_small_L.tif
-io.rgrid D:/14_10_19/31_grid_stereo_test_1_small_R.tif
-io.out D:/14_10_19/31_disparity_map_to_elevation_3_1.tif
-hmin 0
-hmax 286
-step 2
-elev.dem D:/dem/opentopo
The median filter seems to clear most of the noise, but I’m left with these patches, they seem to be linked to large flat area’s with little variation in shadows, some at the highest position on the terrain some at the lowest:
And this clearly shows the noise but also the shoreline drop off:
I haven’t tried referencing a geoid file at the Stereo Rectification Grid Generator step yet, but I gave it DEM folder option so thought that was enough to clarify sea height?