SAGA-GIS Tool Library Documentation (v7.7.0)

Tool Stereo Match (OpenCV)

Stereo Match.


References


Parameters

 NameTypeIdentifierDescriptionConstraints
InputLeft ImageGrid, inputLEFT--
Right ImageGrid, inputRIGHT--
OutputDisparity ImageGrid, outputDISPARITY--
Points (*)Point Cloud, output, optionalPOINTS--
OptionsGrid SystemGrid systemPARAMETERS_GRID_SYSTEM--
AlgorithmChoiceALGORITHM-Available Choices:
[0] Block Matching
[1] Modified Hirschmuller
Default: 0
Minimum DisparityIntegerDISP_MINMinimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.Minimum: 0
Default: 0
Number of DisparitiesIntegerDISP_NUMMaximum disparity minus minimum disparity. The value is always greater than zero.Minimum: 1
Default: 1
Block SizeIntegerBLOCKSIZEThe linear size of the blocks compared by the algorithm. Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence.Minimum: 0
Default: 4
Maximum Disparity DifferenceIntegerDIFF_MAXMaximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.Minimum: -1
Default: 1
Uniqueness RatioIntegerUNIQUENESSMargin in percentage by which the best (minimum) computed cost function value should "win" the second best value to consider the found match correct. Normally, a value within the 5-15 range is good enough.Minimum: 0
Default: 15
Speckle Window SizeIntegerSPECKLE_SIZEMaximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range.Minimum: 0
Default: 100
Speckle RangeIntegerSPECKLE_RANGEMaximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough.Minimum: 0
Default: 2
Texture ThresholdIntegerBM_TEXTURE-Minimum: 0
Default: 31
Prefilter Truncation ValueIntegerBM_FILTER_CAPTruncation value for the prefiltered image pixels.Minimum: 0
Default: 31
ModeChoiceSGBM_MODE-Available Choices:
[0] Semi-Global Block Matching
[1] HH
[2] SGBM 3 Way
Default: 0
Disparity Smoothness Parameter 1IntegerSGBM_P1The larger the value, the smoother the disparity. Parameter 1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1.Minimum: 0
Default: 8
Disparity Smoothness Parameter 2IntegerSGBM_P2The larger the value, the smoother the disparity. Parameter 2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1.Minimum: 0
Default: 32
Prefilter Truncation ValueIntegerSGBM_FILTER_CAPTruncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function.Minimum: 0
Default: 31
(*) optional

Command-line

Usage: saga_cmd imagery_opencv 4 [-LEFT <str>] [-RIGHT <str>] [-DISPARITY <str>] [-POINTS <str>] [-ALGORITHM <str>] [-DISP_MIN <num>] [-DISP_NUM <num>] [-BLOCKSIZE <num>] [-DIFF_MAX <num>] [-UNIQUENESS <num>] [-SPECKLE_SIZE <num>] [-SPECKLE_RANGE <num>] [-BM_TEXTURE <num>] [-BM_FILTER_CAP <num>] [-SGBM_MODE <str>] [-SGBM_P1 <num>] [-SGBM_P2 <num>] [-SGBM_FILTER_CAP <num>]
  -LEFT:<str>           	Left Image
	Grid, input
  -RIGHT:<str>          	Right Image
	Grid, input
  -DISPARITY:<str>      	Disparity Image
	Grid, output
  -POINTS:<str>         	Points
	Point Cloud, output, optional
  -ALGORITHM:<str>      	Algorithm
	Choice
	Available Choices:
	[0] Block Matching
	[1] Modified Hirschmuller
	Default: 0
  -DISP_MIN:<num>       	Minimum Disparity
	Integer
	Minimum: 0
	Default: 0
  -DISP_NUM:<num>       	Number of Disparities
	Integer
	Minimum: 1
	Default: 1
  -BLOCKSIZE:<num>      	Block Size
	Integer
	Minimum: 0
	Default: 4
  -DIFF_MAX:<num>       	Maximum Disparity Difference
	Integer
	Minimum: -1
	Default: 1
  -UNIQUENESS:<num>     	Uniqueness Ratio
	Integer
	Minimum: 0
	Default: 15
  -SPECKLE_SIZE:<num>   	Speckle Window Size
	Integer
	Minimum: 0
	Default: 100
  -SPECKLE_RANGE:<num>  	Speckle Range
	Integer
	Minimum: 0
	Default: 2
  -BM_TEXTURE:<num>     	Texture Threshold
	Integer
	Minimum: 0
	Default: 31
  -BM_FILTER_CAP:<num>  	Prefilter Truncation Value
	Integer
	Minimum: 0
	Default: 31
  -SGBM_MODE:<str>      	Mode
	Choice
	Available Choices:
	[0] Semi-Global Block Matching
	[1] HH
	[2] SGBM 3 Way
	Default: 0
  -SGBM_P1:<num>        	Disparity Smoothness Parameter 1
	Integer
	Minimum: 0
	Default: 8
  -SGBM_P2:<num>        	Disparity Smoothness Parameter 2
	Integer
	Minimum: 0
	Default: 32
  -SGBM_FILTER_CAP:<num>	Prefilter Truncation Value
	Integer
	Minimum: 0
	Default: 31