Package boofcv.alg.disparity.sgm.cost
Class SgmCostBase<T extends ImageBase<T>>
java.lang.Object
boofcv.alg.disparity.sgm.cost.SgmCostBase<T>
- All Implemented Interfaces:
SgmDisparityCost<T>
- Direct Known Subclasses:
SgmCostAbsoluteDifference
,SgmCostHamming
,SgmMutualInformation_U8
public abstract class SgmCostBase<T extends ImageBase<T>>
extends Object
implements SgmDisparityCost<T>
Base class for computing SGM cost using single pixel error metrics. It handles iterating through all possible
disparity values for all pixels in the image and any other book keeping. Only the score needs to be implemented.
-
Field Summary
Modifier and TypeFieldDescriptionprotected GrayU16
protected int
protected int
protected T
protected T
Fields inherited from interface boofcv.alg.disparity.sgm.SgmDisparityCost
MAX_COST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
computeDisparityErrors
(int idxLeft, int idxRight, int idxOut, int localRange) void
configure
(int disparityMin, int disparityRange) Configures the disparity searchvoid
Computes the score for all possible disparity values across all pixels.
-
Field Details
-
left
-
right
-
costXD
-
disparityMin
protected int disparityMin -
disparityRange
protected int disparityRange
-
-
Constructor Details
-
SgmCostBase
public SgmCostBase()
-
-
Method Details
-
configure
public void configure(int disparityMin, int disparityRange) Description copied from interface:SgmDisparityCost
Configures the disparity search- Specified by:
configure
in interfaceSgmDisparityCost<T extends ImageBase<T>>
- Parameters:
disparityMin
- Minimum possible disparity, inclusivedisparityRange
- Number of possible disparity values estimated. The max possible disparity is min+range-1.
-
process
Description copied from interface:SgmDisparityCost
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 toSgmDisparityCost.MAX_COST
- Specified by:
process
in interfaceSgmDisparityCost<T extends ImageBase<T>>
- Parameters:
left
- left imageright
- right imagecostYXD
- Cost of output scaled to have a range of 0 toSgmDisparityCost.MAX_COST
, inclusive. Reshaped to match input and disparity range.
-
computeDisparityErrors
protected abstract void computeDisparityErrors(int idxLeft, int idxRight, int idxOut, int localRange)
-