Generating slow epipolar grids with a DEM not in lon lat
Description
Generating epipolar grids with a DEM
The application StereoRectificationGridGenerator
application and the epi.elevation.dem
parameter takes a very long time when dem is not in lon lat.
result of computing duration on a small srtm file:
- with lon lat dem : 1.4 sec
- with utm dem : 16 sec
Steps to reproduce
-
geoid: https://github.com/CNES/cars/blob/master/cars/conf/geoid/egm96.grd
-
inputs: https://github.com/CNES/cars/blob/master/tutorials/data_gizeh.tar.bz2
untar the file
-
dem in lon lat
srtm_dir/N29E031_KHEOPS.tif
-
dem in utm
gdalwarp -t_srs EPSG:32636 srtm_dir/N29E031_KHEOPS.tif dem.tif
- generating epipolar grids script
import otbApplication
app = otbApplication.Registry.CreateApplication("StereoRectificationGridGenerator")
app.SetParameterString("io.inleft", "data_gizeh/img1.tif")
app.SetParameterString("io.inright", "data_gizeh/img2.tif")
app.SetParameterString("io.outleft", "epi_grid1.tif")
app.SetParameterString("io.outright", "epi_grid2.tif")
app.SetParameterString("epi.elevation.dem", "dem.tif")
app.SetParameterFloat("epi.elevation.default", 0)
app.SetParameterString("epi.elevation.geoid","cars/conf/geoid/egm96.grd")
app.SetParameterInt("epi.step", 30)
app.ExecuteAndWriteOutput()
Configuration information
- OTB 7.4.1 ubuntu 22.04
- install command
RUN cmake \
"-DBUILD_COOKBOOK:BOOL=OFF" "-DBUILD_EXAMPLES:BOOL=OFF" "-DBUILD_SHARED_LIBS:BOOL=ON" \
"-DBUILD_TESTING:BOOL=OFF" "-DOTB_USE_6S:BOOL=OFF" "-DOTB_USE_CURL:BOOL=ON" \
"-DOTB_USE_GLEW:BOOL=OFF" "-DOTB_USE_GLFW:BOOL=OFF" "-DOTB_USE_GLUT:BOOL=OFF" \
"-DOTB_USE_GSL:BOOL=OFF" "-DOTB_USE_LIBKML:BOOL=OFF" "-DOTB_USE_LIBSVM:BOOL=ON" \
"-DOTB_USE_MPI:BOOL=OFF" "-DOTB_USE_MUPARSER:BOOL=ON" "-DOTB_USE_MUPARSERX:BOOL=ON" \
"-DOTB_USE_OPENCV:BOOL=OFF" "-DOTB_USE_OPENGL:BOOL=OFF" "-DOTB_USE_OPENMP:BOOL=OFF" \
"-DOTB_USE_QT:BOOL=OFF" "-DOTB_USE_QWT:BOOL=OFF" "-DOTB_USE_SIFTFAST:BOOL=ON" \
"-DOTB_USE_SPTW:BOOL=OFF" "-DOTB_WRAP_PYTHON:BOOL=ON" "-DCMAKE_BUILD_TYPE=Release" \
"-DOTB_USE_SHARK:BOOL=OFF" "-DBUILD_EXAMPLES:BOOL=OFF" \
-DCMAKE_INSTALL_PREFIX="/usr/local/otb" -GNinja .. && \
ninja install && \