Estimate disparity map between two images.
This application computes a disparity map between two images that correspond to the same scene. It is intended for case where small misregistration between images should be estimated and fixed. The search is performed in 2D.
The algorithm uses an iterative approach to estimate a best match between local patches. The typical use case is registration betwween similar bands, or between two acquisitions. The output image contains X and Y offsets, as well as the metric value. A sub-pixel accuracy can be expected. The input images should have the same size and same physical space.
This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.
-ref image Mandatory
The reference image.
-sec image Mandatory
The secondary 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
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
Performs a gaussian smoothing of the reference image. Parameter is gaussian sigma (in pixels) in X direction.
Reference Gaussian Smoothing Y
Performs a gaussian smoothing of the reference image. Parameter is gaussian sigma (in pixels) in Y direction.
Secondary Gaussian Smoothing X
Performs a gaussian smoothing of the secondary image. Parameter is gaussian sigma (in pixels) in X direction.
Secondary Gaussian Smoothing Y
Performs a gaussian smoothing of the secondary image. Parameter is gaussian sigma (in pixels) in Y direction.
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
-spa float Default value: 0.01
Metric extrema location will be refined up to the given accuracy. Default is 0.01
-cva float Default value: 0.01
Metric extrema will be refined up to the given accuracy. Default is 0.01
Validity Mask Lower Threshold
Lower threshold to compute the validity mask. This mask will be the 4th output band.
Validity Mask Upper Threshold
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).
From the command-line:
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
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()