Converts detection masks from a geosam object to a terra SpatRaster.
Arguments
- x
A geosam object from
sam_detect()orsam_explore().- combined
If TRUE, combine all masks into a single layer (union). If FALSE (default), return a multi-layer raster with one layer per detection.
Examples
if (FALSE) { # \dontrun{
result <- sam_detect(image = "satellite.tif", text = "building")
mask_raster <- sam_as_raster(result, combined = TRUE)
terra::plot(mask_raster)
} # }
