kmeans

Ik = kmeans(I::GMTimage, k=5; seeds=nothing, maxiter=100, tol=1e-7, V=false) -> GMTimage

Compute a k-means clustering on an RGB image I. It produces a fixed number of clusters, each associated with a center, and each RGB color is assigned to a cluster with the nearest center.

kmeans(X::Union{GMTdataset, Matrix{<:Real}}, k=3; seeds=nothing, maxiter=100, tol=1e-7,
       raw::Bool=false, V=false) -> Vector{GMTdataset} | idx, centers, counts

This method accepts a M-by-d matrix or a \(GMTdataset\) where columns represent the data points and rows the d-dimensional data point.

Example

    D = gmtread(TESTSDIR * "iris.dat");
    Dk = kmeans(D, k=3)     # Unsupervised segment data into 3 clusters.

Methods

# 4 methods for generic function "kmeans" from GMT:
 [1] kmeans(X::Union{GMTdataset, Matrix{<:Real}}, k; seeds, maxiter, tol, raw, V)
 [2] kmeans(X::Union{GMTdataset, Matrix{<:Real}}; ...)
 [3] kmeans(I::GMTimage, k; seeds, maxiter, tol, V)
 [4] kmeans(I::GMTimage; ...)

See Also