public class KMColourSegmenter extends Object implements Segmenter<org.openimaj.image.MBFImage>
| Modifier and Type | Field and Description |
|---|---|
protected org.openimaj.image.colour.ColourSpace |
colourSpace |
protected FloatKMeans |
kmeans |
protected float[] |
scaling |
| Constructor and Description |
|---|
KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace,
float[] scaling,
int K,
FloatFVComparator distance)
Construct using the given colour space, number of segments, and distance
measure.
|
KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace,
float[] scaling,
int K,
FloatFVComparator distance,
int maxIters)
Construct using the given colour space, number of segments, and distance
measure.
|
KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace,
int K)
Construct using the given colour space and number of segments.
|
KMColourSegmenter(org.openimaj.image.colour.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(org.openimaj.image.MBFImage image) |
List<? extends org.openimaj.image.pixel.PixelSet> |
segment(org.openimaj.image.MBFImage image)
Segment an image into
ConnectedComponents. |
protected org.openimaj.image.colour.ColourSpace colourSpace
protected float[] scaling
protected FloatKMeans kmeans
public KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace, int K)
colourSpace - the colour spaceK - the number of segmentspublic KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace, int K, FloatFVComparator distance)
colourSpace - the colour spaceK - the number of segmentsdistance - the distance measurepublic KMColourSegmenter(org.openimaj.image.colour.ColourSpace colourSpace, float[] scaling, int K, FloatFVComparator distance)
colourSpace - the colour spacescaling - the scaling vectorK - the number of segmentsdistance - the distance measurepublic KMColourSegmenter(org.openimaj.image.colour.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(org.openimaj.image.MBFImage image)