Package boofcv.alg.disparity.sgm
Interface SgmDisparityCost<T extends ImageBase<T>>
- All Known Implementing Classes:
SgmCostAbsoluteDifference
,SgmCostAbsoluteDifference.U8
,SgmCostBase
,SgmCostFromBlocks
,SgmCostHamming
,SgmCostHamming.S32
,SgmCostHamming.S64
,SgmCostHamming.U8
,SgmMutualInformation_U8
public interface SgmDisparityCost<T extends ImageBase<T>>
Computes a stack of matching costs for all pixels across all possible disparities for use
with SgmCostAggregation
. Pay close attention to the element ordering in the output. Ordering was
selected to reduce CPU cache misses when aggregating the costs.
The output is really a 3D tensor, but to avoid creating another custom data type planar images are used. The other reason to use a planar image is that it was desirable to have multiple arrays define the tensor.
Format of costYXD. YXD indicates the ordering of values in the tensor. The outer most is T, which is the bands. X is the row in a planar image and D the columns. Thus, (y,x,d) = costYXD.getBand(y).get(d,x-disparityMin).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Maximum allowed cost fo a disparity 11-bits as suggested in the paper -
Method Summary
-
Field Details
-
MAX_COST
static final int MAX_COSTMaximum allowed cost fo a disparity 11-bits as suggested in the paper- See Also:
-
-
Method Details
-
configure
void configure(int disparityMin, int disparityRange) Configures the disparity search- Parameters:
disparityMin
- Minimum possible disparity, inclusivedisparityRange
- Number of possible disparity values estimated. The max possible disparity is min+range-1.
-
process
Computes the score for all possible disparity values across all pixels. If a disparity value would go outside of the image then the cost is set toMAX_COST
- Parameters:
left
- left imageright
- right imagecostYXD
- Cost of output scaled to have a range of 0 toMAX_COST
, inclusive. Reshaped to match input and disparity range.
-