kImage | R Documentation |
kmeans
clustering of image imported as a RasterStack. This function is
used by patLanK
and patRegK
.kmeans
clustering of image imported as a RasterStack. This function is
used by patLanK
and patRegK
.
kImage(image, k = 5, startCenter = NULL, maskToNA = NULL, kmeansOnAll = FALSE)
image |
Image imported as a RasterStack for k-means clustering. |
k |
Integer for number of k-means clusters (default = 3). |
startCenter |
A matrix of cluster centres to start k-means clustering from (default = NULL). |
maskToNA |
Replace the color value used for masking (i.e. 0 or 255) with NA. |
kmeansOnAll |
Whether to perform the kmeans clusters on the combined set of pixels of all images first (default = FALSE). |
List including the k-means clustered RasterSatck
returned as an array and object
of class "kmeans
".
image <- raster::stack(system.file("extdata", "BC0077.jpg", package = "patternize"))
out <- kImage(image, 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.