Learn R Programming

sits (version 1.4.0)

sits_supercells: Segment an image using supercells

Description

Apply a segmentation on a data cube based on the "supercells" package. This is an adaptation and extension to remote sensing data of the SLIC superpixels algorithm proposed by Achanta et al. (2012). See references for more details.

Usage

sits_supercells(
  cube,
  tiles = NULL,
  bands,
  date,
  step = 50,
  compactness = 1,
  iter = 10,
  minarea = 30,
  multicores = 1
)

Arguments

cube

Regular data cube

tiles

Tiles to be segmented

bands

Bands to include in the segmentation

date

Date to select the image to be segmented

step

Distance (in number of cells) between initial supercells' centers.

compactness

A compactness value. Larger values cause clusters to be more compact/even (square).

iter

Number of iterations to create the output.

minarea

Specifies the minimal size of a supercell (in cells).

multicores

Number of cores for parallel processing

Author

Gilberto Camara, gilberto.camara@inpe.br

Rolf Simoes, rolf.simoes@inpe.br

Felipe Carvalho, felipe.carvalho@inpe.br

References

Achanta, Radhakrishna, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Süsstrunk. 2012. “SLIC Superpixels Compared to State-of-the-Art Superpixel Methods.” IEEE Transactions on Pattern Analysis and Machine Intelligence 34 (11): 2274–82.

Nowosad, Jakub, and Tomasz F. Stepinski. 2022. “Extended SLIC Superpixels Algorithm for Applications to Non-Imagery Geospatial Rasters.” International Journal of Applied Earth Observation and Geoinformation 112 (August): 102935.

Examples

Run this code
# example code
if (sits_run_examples()) {
    # Example of classification of a data cube
    # create a data cube from local files
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6",
        data_dir = data_dir
    )
    # segment the image
    segments <- sits_supercells(
        cube = cube,
        tile = "012010",
        bands = "NDVI",
        date = sits_timeline(cube)[1],
        step = 10
    )
}

Run the code above in your browser using DataLab