public class KMColourSegmenter extends Object implements Segmenter<MBFImage>
Modifier and Type | Field and Description |
---|---|
protected ColourSpace |
colourSpace |
protected FloatKMeans |
kmeans |
protected float[] |
scaling |
Constructor and Description |
---|
KMColourSegmenter(ColourSpace colourSpace,
float[] scaling,
int K,
FloatFVComparator distance)
Construct using the given colour space, number of segments, and distance
measure.
|
KMColourSegmenter(ColourSpace colourSpace,
float[] scaling,
int K,
FloatFVComparator distance,
int maxIters)
Construct using the given colour space, number of segments, and distance
measure.
|
KMColourSegmenter(ColourSpace colourSpace,
int K)
Construct using the given colour space and number of segments.
|
KMColourSegmenter(ColourSpace colourSpace,
int K,
FloatFVComparator distance)
Construct using the given colour space, number of segments, and distance
measure.
|
Modifier and Type | Method and Description |
---|---|
protected float[][] |
imageToVector(MBFImage image) |
List<? extends PixelSet> |
segment(MBFImage image)
Segment an image into
ConnectedComponent s. |
protected ColourSpace colourSpace
protected float[] scaling
protected FloatKMeans kmeans
public KMColourSegmenter(ColourSpace colourSpace, int K)
colourSpace
- the colour spaceK
- the number of segmentspublic KMColourSegmenter(ColourSpace colourSpace, int K, FloatFVComparator distance)
colourSpace
- the colour spaceK
- the number of segmentsdistance
- the distance measurepublic KMColourSegmenter(ColourSpace colourSpace, float[] scaling, int K, FloatFVComparator distance)
colourSpace
- the colour spacescaling
- the scaling vectorK
- the number of segmentsdistance
- the distance measurepublic KMColourSegmenter(ColourSpace colourSpace, float[] scaling, int K, FloatFVComparator distance, int maxIters)
maxIters
times.colourSpace
- the colour spacescaling
- the scaling vectorK
- the number of segmentsdistance
- the distance measuremaxIters
- the maximum number of iterations to performprotected float[][] imageToVector(MBFImage image)
public List<? extends PixelSet> segment(MBFImage image)
Segmenter
ConnectedComponent
s.segment
in interface Segmenter<MBFImage>
image
- the to segmentConnectedComponent
s.