mosaic_segment_pick | R Documentation |
The function segments a mosaic using an interative process where the user picks samples from background (eg., soil) and foreground (eg., plants).
mosaic_segment_pick(
mosaic,
basemap = NULL,
g = 2,
r = 3,
b = 1,
max_pixels = 2e+06,
downsample = NULL,
quantiles = c(0, 1),
return = c("mosaic", "mask")
)
mosaic |
A mosaic of class |
basemap |
An optional |
r , g , b |
The layer for the Red, Green and Blue band, respectively.
Defaults to |
max_pixels |
Maximum number of pixels to render in the map or plot (default: 500000). |
downsample |
Downsampling factor to reduce the number of pixels
(default: NULL). In this case, if the number of pixels in the image (width
x height) is greater than |
quantiles |
the upper and lower quantiles used for color stretching. |
return |
The output of the function. Either 'mosaic' (the segmented mosaic), or 'mask' (the binary mask). |
An SpatRaster
object with the segmented mosaic
(if return = 'mosaic'
) or a mask (if return = 'mask'
).
if(interactive()){
mosaic <- mosaic_input(system.file("ex/elev.tif", package="terra"))
seg <- mosaic_segment_pick(mosaic)
mosaic_plot(seg)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.