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
Modifier and TypeFieldDescriptionprotected float
protected T
protected InterpolatePixelS<T>
protected int
protected boolean
protected float
protected float
protected int
protected WeightPixel_F32
protected int
-
Constructor Summary
ConstructorDescriptionMeanShiftPeak
(int maxIterations, float convergenceTol, WeightPixel_F32 weights, boolean odd, Class<T> imageType, BorderType borderType) Configures search. -
Method Summary
Modifier and TypeMethodDescriptionvoid
search
(float cx, float cy) Performs a mean-shift search center at the specified coordinatesvoid
searchPositive
(float cx, float cy) Performs a mean-shift search center at the specified coordinates but with negative weights ignoredvoid
Specifies the input imagevoid
setRadius
(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
-