FineRegistration - Fine Registration¶
Estimate disparity map between two images.
Detailed description¶
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.
Parameters¶
This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is FineRegistration .
[1] | Table: Parameters table for Fine Registration. |
Parameter Key | Parameter Name | Parameter Type |
---|---|---|
ref | Reference Image | Input image |
sec | Secondary Image | Input image |
out | Output Image | Output image |
erx | Exploration Radius X | Int |
ery | Exploration Radius Y | Int |
mrx | Metric Radius X | Int |
mry | Metric Radius Y | Int |
w | Image To Warp | Input image |
wo | Output Warped Image | Output image |
cox | Coarse Offset X | Float |
coy | Coarse Offset Y | Float |
ssrx | Sub-Sampling Rate X | Float |
ssry | Sub-Sampling Rate Y | Float |
rgsx | Reference Gaussian Smoothing X | Float |
rgsy | Reference Gaussian Smoothing Y | Float |
sgsx | Secondary Gaussian Smoothing X | Float |
sgsy | Secondary Gaussian Smoothing Y | Float |
m | Metric | String |
spa | SubPixelAccuracy | Float |
cva | ConvergenceAccuracy | Float |
vmlt | Validity Mask Lower Threshold | Float |
vmut | Validity Mask Upper Threshold | Float |
ram | Available RAM (Mb) | Int |
inxml | Load otb application from xml file | XML input parameters file |
outxml | Save otb application to xml file | XML output parameters file |
- Reference Image: The reference image.
- Secondary Image: The secondary image.
- Output Image: 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: The exploration radius along x (in pixels).
- Exploration Radius Y: The exploration radius along y (in pixels).
- Metric Radius X: Radius along x (in pixels) of the metric computation window.
- Metric Radius Y: 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: The output warped image.
- Coarse Offset X: Coarse offset along x (in physical space) between the two images, used as an initial offset for all pixels.
- Coarse Offset Y: Coarse offset along y (in physical space) between the two images, used as an initial offset for all pixels.
- Sub-Sampling Rate X: Generates a result at a coarser resolution with a given sub-sampling rate along X.
- Sub-Sampling Rate Y: 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.
- Metric: 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: Metric extrema location will be refined up to the given accuracy. Default is 0.01.
- ConvergenceAccuracy: 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): Available memory for processing (in MB).
- Load otb application from xml file: Load otb application from xml file.
- Save otb application to xml file: Save otb application to xml file.
Example¶
To run this example in command-line, use the following:
otbcli_FineRegistration -ref StereoFixed.png -sec StereoMoving.png -out FineRegistration.tif -erx 2 -ery 2 -mrx 3 -mry 3
To run this example from Python, use the following code snippet:
#!/usr/bin/python
# Import the otb applications package
import otbApplication
# The following line creates an instance of the FineRegistration application
FineRegistration = otbApplication.Registry.CreateApplication("FineRegistration")
# The following lines set all the application parameters:
FineRegistration.SetParameterString("ref", "StereoFixed.png")
FineRegistration.SetParameterString("sec", "StereoMoving.png")
FineRegistration.SetParameterString("out", "FineRegistration.tif")
FineRegistration.SetParameterInt("erx", 2)
FineRegistration.SetParameterInt("ery", 2)
FineRegistration.SetParameterInt("mrx", 3)
FineRegistration.SetParameterInt("mry", 3)
# The following line execute the application
FineRegistration.ExecuteAndWriteOutput()
Limitations¶
None
Authors¶
This application has been written by OTB-Team.