Package boofcv.alg.feature.detect.peak
Class MeanShiftPeak<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.feature.detect.peak.MeanShiftPeak<T>
Simple implementations of mean-shift intended to finding local peaks inside an intensity image.
Implementations differ in how they weigh each point. In each iterations the mean of the square sample region
centered around the target is computed and the center shifted so that location. It stops when change
is less than a delta or the maximum number of iterations has been exceeded.
If the image border is hit while searching the square will be push back until it is entirely contained inside
the image.
This is NOT thread safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected Tprotected InterpolatePixelS<T>protected intprotected booleanprotected floatprotected floatprotected intprotected WeightPixel_F32protected int -
Constructor Summary
ConstructorsConstructorDescriptionMeanShiftPeak(int maxIterations, float convergenceTol, WeightPixel_F32 weights, boolean odd, Class<T> imageType, BorderType borderType) Configures search. -
Method Summary
Modifier and TypeMethodDescriptionvoidsearch(float cx, float cy) Performs a mean-shift search center at the specified coordinatesvoidsearchPositive(float cx, float cy) Performs a mean-shift search center at the specified coordinates but with negative weights ignoredvoidSpecifies the input imagevoidsetRadius(int radius)
-
Field Details
-
image
-
interpolate
-
maxIterations
protected int maxIterations -
radius
protected int radius -
width
protected int width -
convergenceTol
protected float convergenceTol -
peakX
protected float peakX -
peakY
protected float peakY -
odd
protected boolean odd -
weights
-
-
Constructor Details
-
MeanShiftPeak
public MeanShiftPeak(int maxIterations, float convergenceTol, WeightPixel_F32 weights, boolean odd, Class<T> imageType, BorderType borderType) Configures search.- Parameters:
maxIterations- Maximum number of iterations. Try 10convergenceTol- Convergence tolerance. Try 1e-3weights- Used to compute the weight each pixel contributes to the mean. Try a uniform distribution.
-
-
Method Details
-
setImage
Specifies the input image- Parameters:
image- input image
-
setRadius
public void setRadius(int radius) -
search
public void search(float cx, float cy) Performs a mean-shift search center at the specified coordinates -
searchPositive
public void searchPositive(float cx, float cy) Performs a mean-shift search center at the specified coordinates but with negative weights ignored
-