FineRegistration¶
估计两幅图像之间的视差图。
描述¶
这个应用程序计算对应于同一场景的两幅图像之间的视差图。它适用于需要估计和修复图像之间的微小配准错误的情况。搜索是以2D方式执行的。
该算法使用迭代方法来估计局部块之间的最佳匹配。典型的用例是相似频段之间或两个收购之间的注册。输出图像包含X和Y偏移量以及度量值。亚像素精度是可以预期的。输入图像应具有相同的大小和相同的物理空间。
这个应用程序有几个输出图像,并支持“多写”。不是独立地计算和写入每个图像,而是以同步的方式为每个输出写入流图像块。输出图像将逐条计算,使用可用的RAM计算条带大小,并且可以使用流扩展文件名(类型、模式和值)指定用户定义的流模式。请注意,可以使用多写扩展文件名选项禁用多写,在这种情况下,将逐个写入输出图像。请注意,MPI编写器不支持多重写入。
参数¶
Reference Image -ref image
Mandatory
The reference image.
Secondary Image -sec image
Mandatory
The secondary image.
Output Image -out image [dtype]
Mandatory
The output image contains 3 bands, for X offset, Y offset and the metric value. It may contain a 4th one with the validity mask (if used).
Exploration Radius X -erx int
Mandatory
The exploration radius along x (in pixels)
Exploration Radius Y -ery int
Mandatory
The exploration radius along y (in pixels)
Metric Radius X -mrx int
Mandatory
Radius along x (in pixels) of the metric computation window
Metric Radius Y -mry int
Mandatory
Radius along y (in pixels) of the metric computation window
Image To Warp -w image
The image to warp after disparity estimation is completed.
Output Warped Image -wo image [dtype]
The output warped image
Coarse Offset X -cox float
Default value: 0
Coarse offset along x (in physical space) between the two images, used as an initial offset for all pixels.
Coarse Offset Y -coy float
Default value: 0
Coarse offset along y (in physical space) between the two images, used as an initial offset for all pixels.
Sub-Sampling Rate X -ssrx float
Default value: 1
Generates a result at a coarser resolution with a given sub-sampling rate along X
Sub-Sampling Rate Y -ssry float
Default value: 1
Generates a result at a coarser resolution with a given sub-sampling rate along Y
Reference Gaussian Smoothing X -rgsx float
Performs a gaussian smoothing of the reference image. Parameter is gaussian sigma (in pixels) in X direction.
Reference Gaussian Smoothing Y -rgsy float
Performs a gaussian smoothing of the reference image. Parameter is gaussian sigma (in pixels) in Y direction.
Secondary Gaussian Smoothing X -sgsx float
Performs a gaussian smoothing of the secondary image. Parameter is gaussian sigma (in pixels) in X direction.
Secondary Gaussian Smoothing Y -sgsy float
Performs a gaussian smoothing of the secondary image. Parameter is gaussian sigma (in pixels) in Y direction.
Metric -m string
Choose the metric used for block matching. Available metrics are cross-correlation (CC), cross-correlation with subtracted mean (CCSM), mean-square difference (MSD), mean reciprocal square difference (MRSD) and mutual information (MI). Default is cross-correlation
SubPixelAccuracy -spa float
Default value: 0.01
Metric extrema location will be refined up to the given accuracy. Default is 0.01
ConvergenceAccuracy -cva float
Default value: 0.01
Metric extrema will be refined up to the given accuracy. Default is 0.01
Validity Mask Lower Threshold -vmlt float
Lower threshold to compute the validity mask. This mask will be the 4th output band.
Validity Mask Upper Threshold -vmut float
Upper threshold to obtain a validity mask. This mask will be the 4th output band.
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_FineRegistration -ref StereoFixed.png -sec StereoMoving.png -out FineRegistration.tif -erx 2 -ery 2 -mrx 3 -mry 3 -w StereoMoving.png -wo StereoMoving_FineRegistered.png
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("FineRegistration")
app.SetParameterString("ref", "StereoFixed.png")
app.SetParameterString("sec", "StereoMoving.png")
app.SetParameterString("out", "FineRegistration.tif")
app.SetParameterInt("erx", 2)
app.SetParameterInt("ery", 2)
app.SetParameterInt("mrx", 3)
app.SetParameterInt("mry", 3)
app.SetParameterString("w", "StereoMoving.png")
app.SetParameterString("wo", "StereoMoving_FineRegistered.png")
app.ExecuteAndWriteOutput()