cube_seg: Image segmentation

View source: R/cube_seg.R

cube_segR Documentation

Image segmentation

Description

Performs image segmentation with the kmeans algorithm.

Usage

cube_seg(cube, type = "kmeans", lclump = TRUE, plot = TRUE, ...)

Arguments

cube

The hyperspectral cube returned by the function cube_read

type

Type of image segmentation. 'kmeans' is the only accepted value.

lclump

Logical. Keep only the largest clump? See Details.

...

Arguments to be passed to kmeans.

Details

This function provides an interactive too to classify and reclassify (aggregate) the image in clusters.

If lclump is TRUE, after image classification and possibly reclassification, the clump function of the raster package is called to identify clumps of contiguous pixels. This is a spatial classification. Only the largerst clump will be kept. This is a fine tune aid to the spectral classification when trying to extract a single contigous region (target surface) and the spectral classification results in isolated pixels or small clumps of pixels

Value

The same cube as the input, with the clusters as a raster layer in the attribute 'metadata'.


AlexCast/surfspec documentation built on July 7, 2022, 9:35 a.m.