Program options:
iap: k-means clustering
options:
-a accounting (generates .html output data file)
-d destroy empty classes
-i <mode> initialization mode:
random pixels randomly distributed among classes
distrib initial means distributed across color space
hier hierarchical initialization method
-o <tag> output tag (output image filename is <image>.<tag>.ppm)
-p <n> floating-point precision set to n bits
(must be between 1 and 16, defaults to 4)
-r empty classes randomly reinitialized
-xy <percent> spatial data weighting factor (0-100, defaults to 0).
Initialization methods:
- random:
Each pixel is initially assigned to a random class. Initial means are
computed from this assignment.
- distributed:
Initial means are dsitributed evenly across the color space.
- hierarchical:
256 pixels are randomly selected from the image and placed in a 16x16
image. The algorithm is run on this small image (using the random
initalization method) and the final class means are used to initialize
the classes.
Treatment of empty classes:
At the end of an iteration, new means are computed by dividing the
channel and xy sums by the number of pixels in the class. In the case
where a class has no pixels in it, this would result in division by 0.
This program has three options for dealing with these empty classes:
- Left alone (default):
At the end of an iteration, the means of an empty class are left
undisturbed. Pixels could be assigned to this class in subsequent
iterations.
- Randomly reinitialized:
At the end of the iteration, empty classes have their means (channel and
xy) reset to a random value within the appropriate range. These classes
can have pixels assigned to them in future iterations.
- Killed:
At the end of an interation, empty classes are marked "dead" and cannot
be reused.
Other information:
- Runs until no pixels change classes, or for 50 iterations,
whichever comes first.
- For RGB images, two PPM output files are written.
imagename.<tag>.ppm (mean color output) and
imagename.<tag>s.ppm (random color output). Only the latter is
written for non-RGB images.
These pages created by Valerie Ohm (valerie@ece.neu.edu) at the Rapid Prototyping Laboratory at Northeastern University
Contact: Prof. Miriam Leeser (mel@ece.neu.edu)