# BlockMatching

## Brief Description

Performs block-matching to estimate pixel-wise disparities between two images

## Tags

Stereo

## Long Description

This application allows performing block-matching to estimate pixel-wise disparities between two images. The application allows choosing the block-matching method to use. It also allows inputting masks (related to the left and right input image) of pixels for which the disparity should be investigated. Additionally, two criteria can be optionally used to disable disparity investigation for some pixel: a no-data value, and a threshold on the local variance. This allows speeding up computation by avoiding to investigate disparities that will not be reliable anyway. For efficiency reasons, if the optimal metric values image is desired, it will be concatenated to the output image (which will then have three bands : horizontal disparity, vertical disparity and metric value). One can split these images afterward.

## Parameters

- [param] -io <string> This group of parameters allows setting the input and output images.. Mandatory: True. Default Value: "0"
- [param] -mask <string> This group of parameters allows determining the masking parameters to prevent disparities estimation for some pixels of the left image. Mandatory: True. Default Value: "0"
- [param] -bm <string> This group of parameters allow to tune the block-matching behaviour. Mandatory: True. Default Value: "0"
- [param] -ram <int32> Available memory for processing (in MB). Mandatory: False. Default Value: "128"

## Limitations

None

## Authors

OTB-Team

## See Also

otbStereoRectificationGridGenerator

## Example of use

- io.inleft: StereoFixed.png

- io.inright: StereoMoving.png

- bm.minhd: -10

- bm.maxhd: 10

- mask.variancet: 10

- io.out: MyDisparity.tif