StereoRectificationGridGenerator

生成两个变形场以在极几何图形中重新采样,一对立体图像达到传感器模型的精度

描述

这个应用程序生成一对变形网格,根据传感器建模和平均海拔假设对一对立体图像进行立体校正。

这个应用程序是立体重建框架的第一部分。可以将输出变形栅格传递给 GridBasedImageResampling 实际重采样到极线几何的应用。

有几种方法可以设置高程源:

  • 任意恒定高程
  • 数字高程模型目录
  • 从DEM计算平均高程

如果需要,该应用程序可以计算反向重采样网格(从核线到原始传感器几何图形)。不要忘记检查应用程序的其他输出。例如,该应用程序给出了校正后的图像的X和Y大小,以及估计的基线比率。

这个应用程序有几个输出图像,并支持“多写”。不是独立地计算和写入每个图像,而是以同步的方式为每个输出写入流图像块。输出图像将逐条计算,使用可用的RAM计算条带大小,并且可以使用流扩展文件名(类型、模式和值)指定用户定义的流模式。请注意,可以使用多写扩展文件名选项禁用多写,在这种情况下,将逐个写入输出图像。请注意,MPI编写器不支持多重写入。

参数

输入和输出数据

这组参数允许设置输入和输出图像。

Left input image -io.inleft image Mandatory
The left image from the stereo pair, in sensor geometry.

Right input image -io.inright image Mandatory
The right image from the stereo pair, in sensor geometry.

Left output deformation grid -io.outleft image [dtype] Mandatory
The deformation grid to resample the left image from sensor geometry to epipolar geometry.

Right output deformation grid -io.outright image [dtype] Mandatory
The deformation grid to resample the right image from sensor geometry to epipolar geometry.

极线几何和栅格参数

极线几何参数和输出栅格

高程管理

这组参数允许管理高程值。

DEM directory -epi.elevation.dem directory
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. Input DEM tiles should be in a raster format supported by GDAL.

Geoid File -epi.elevation.geoid filename [dtype]
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 (egm96.grd and egm96.grd.hdr at https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/master/Data/Input/DEM).

Default elevation -epi.elevation.default float Default value: 0
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.

由DEM计算的平均高程

根据提供的DEM计算的平均高程

Sub-sampling step -epi.elevation.avgdem.step int Default value: 1
Step of sub-sampling for average elevation estimation

Average elevation value -epi.elevation.avgdem.value float Mandatory
Average elevation value estimated from DEM

Minimum disparity from DEM -epi.elevation.avgdem.mindisp float Mandatory
Disparity corresponding to estimated minimum elevation over the left image

Maximum disparity from DEM -epi.elevation.avgdem.maxdisp float Mandatory
Disparity corresponding to estimated maximum elevation over the left image


Scale of epipolar images -epi.scale float Default value: 1
The scale parameter allows generating zoomed-in (scale < 1) or zoomed-out (scale > 1) epipolar images.

Step of the deformation grid (in number of pixels) -epi.step int Default value: 1
Stereo-rectification deformation grid only varies slowly. Therefore, it is recommended to use a coarser grid (higher step value) in case of large images

Rectified image size X -epi.rectsizex int Mandatory
The application computes the optimal rectified image size so that the whole left input image fits into the rectified area. However, due to the scale and step parameter, this size may not match the size of the deformation field output. In this case, one can use these output values.

Rectified image size Y -epi.rectsizey int Mandatory
The application computes the optimal rectified image size so that the whole left input image fits into the rectified area. However, due to the scale and step parameter, this size may not match the size of the deformation field output. In this case, one can use these output values.

Mean baseline ratio -epi.baseline float Mandatory
This parameter is the mean value, in pixels.meters^-1, of the baseline to sensor altitude ratio. It can be used to convert disparities to physical elevation, since a disparity of one pixel will correspond to an elevation offset of the invert of this value with respect to the mean elevation.

写入反字段

这组参数还允许生成逆场

Left inverse deformation grid -inverse.outleft image [dtype]
The deformation grid to resample the left image from the epipolar geometry back into its original sensor geometry.

Right inverse deformation grid -inverse.outright image [dtype]
The output deformation grid to resample the right image from the epipolar geometry back into its original sensor geometry.

Sub-sampling rate for inversion -inverse.ssrate int Default value: 16
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.


Available RAM (MB) -ram int Default value: 256
Available memory for processing (in MB).

实例

从命令行执行以下操作:

otbcli_StereoRectificationGridGenerator -io.inleft wv2_xs_left.tif -io.inright wv2_xs_left.tif -io.outleft wv2_xs_left_epi_field.tif -io.outright wv2_xs_right_epi_field.tif -epi.elevation.default 400

来自Python的评论:

import otbApplication

app = otbApplication.Registry.CreateApplication("StereoRectificationGridGenerator")

app.SetParameterString("io.inleft", "wv2_xs_left.tif")
app.SetParameterString("io.inright", "wv2_xs_left.tif")
app.SetParameterString("io.outleft", "wv2_xs_left_epi_field.tif")
app.SetParameterString("io.outright", "wv2_xs_right_epi_field.tif")
app.SetParameterFloat("epi.elevation.default", 400)

app.ExecuteAndWriteOutput()

局限性

变形网格的生成是不可流畅的,设置网格步长时请注意这一点。

另请参阅

OTB:ref:GridBasedImageRessaming