Package boofcv.alg.tracker.meanshift
Class LikelihoodHueSatHistCoupled_PL_U8
java.lang.Object
boofcv.alg.tracker.meanshift.LikelihoodHueSatHistCoupled_PL_U8
- All Implemented Interfaces:
PixelLikelihood<Planar<GrayU8>>
,SparseImageOperator<Planar<GrayU8>>
,SparseImageSample_F32<Planar<GrayU8>>
public class LikelihoodHueSatHistCoupled_PL_U8
extends Object
implements PixelLikelihood<Planar<GrayU8>>
TODO redo comments
Converts an RGB image into HSV image to add invariance to changes in lighting conditions. Creates independent
histograms for the target's Hue and Saturation, which are then normalized such that
their sums are equal to one. Likelihood is computed multiply the value of the histograms together.
Colors with a very small "Value" are ignored since their hue and saturation are not reliable.
-
Field Summary
Modifier and TypeFieldDescriptionprotected float[]
protected int
protected float
protected int
protected float
protected float
-
Constructor Summary
ConstructorDescriptionLikelihoodHueSatHistCoupled_PL_U8
(int maxPixelValue, int numHistogramBins) Configures likelihood function -
Method Summary
Modifier and TypeMethodDescriptionfloat
compute
(int x, int y) void
createModel
(RectangleLength2D_I32 target) Specifies where the initial location of the target is in the image and computes the model using pixels inside the rectangleboolean
isInBounds
(int x, int y) Checks to see if the entire sample region is contained inside the image or not.void
Specifies the image being processed.
-
Field Details
-
numHistogramBins
protected int numHistogramBins -
maxElementInBin
protected int maxElementInBin -
minimumValue
protected float minimumValue -
bins
protected float[] bins -
sizeH
protected float sizeH -
sizeS
protected float sizeS
-
-
Constructor Details
-
LikelihoodHueSatHistCoupled_PL_U8
public LikelihoodHueSatHistCoupled_PL_U8(int maxPixelValue, int numHistogramBins) Configures likelihood function- Parameters:
maxPixelValue
- The maximum intensity value a pixel can take on.numHistogramBins
- Number of bins in the Hue and Saturation histogram.
-
-
Method Details
-
setImage
Description copied from interface:SparseImageOperator
Specifies the image being processed.- Specified by:
setImage
in interfaceSparseImageOperator<Planar<GrayU8>>
- Parameters:
image
- Image being processed
-
isInBounds
public boolean isInBounds(int x, int y) Description copied from interface:SparseImageOperator
Checks to see if the entire sample region is contained inside the image or not. Depending on the implementation it might be able to handle out of bounds pixels or not.- Specified by:
isInBounds
in interfaceSparseImageOperator<Planar<GrayU8>>
-
createModel
Description copied from interface:PixelLikelihood
Specifies where the initial location of the target is in the image and computes the model using pixels inside the rectangle- Specified by:
createModel
in interfacePixelLikelihood<Planar<GrayU8>>
- Parameters:
target
- Location of target inside the image
-
compute
public float compute(int x, int y) - Specified by:
compute
in interfaceSparseImageSample_F32<Planar<GrayU8>>
-