Modified k-means classification

This tool is an unsupervised classification method to be applied to multi-spectral remotely sensed imagery. This classification algorithm is very similar to the traditional k-Means Classification method and the common ISODATA technique. The main difference between the traditional k-means and this technique is that the user does not need to specify the desired number of classes/clusters prior to running the tool. Instead, the algorithm initializes with a very liberal overestimate of the number of classes and then merges classes that have cluster centres that are separated by less than a user-defined threshold. The main difference between this algorithm and the ISODATA technique is that clusters can not be broken apart into two smaller clusters. This modified k-means algorithm is similar to that described by Mather (2004).

See Also:

Scripting:

The following is an example of a Python script using this tool:

wd = pluginHost.getWorkingDirectory()
# You may have multiple input files but they must
# be separated by semicolons in the string.
inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
outputFile = wd + "output.dep"
maxNumIterations = "25"
changeThreshold = "2.0"
mergerDist = "5.0"
maxAllowableDist = "not specified"
minClassSize = "5"
initialize = "randomly"
args = [inputFiles, outputFile, maxNumIterations, changeThreshold, mergerDist, maxAllowableDist, minClassSize, initialize]
pluginHost.runPlugin("ModifiedKMeans", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
// You may have multiple input files but they must
// be separated by semicolons in the string.
def inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
def outputFile = wd + "output.dep"
def maxNumIterations = "25"
def changeThreshold = "2.0"
def mergerDist = "5.0"
def maxAllowableDist = "not specified"
def minClassSize = "5"
def initialize = "with max dispersion along diagonal"
String[] args = [inputFiles, outputFile, maxNumIterations, changeThreshold, mergerDist, maxAllowableDist, minClassSize, initialize]
pluginHost.runPlugin("ModifiedKMeans", args, false)

Credits:

References: