if (FALSE) {
## load packages
library(link2GI)
library(OTBsegm)
library(terra)
## load sample image
image_sr <- rast(system.file("raster/pnoa.tiff", package = "OTBsegm"))
## connect to OTB (change to your directory)
otblink <- link2GI::linkOTB(searchLocation = "C:/OTB/")
## apply segmentation
results_ms_sf <- segm_mprofiles(
image = image_sr,
otb = otblink,
size = 5,
start = 3,
step = 20,
sigma = 1
)
}
Run the code above in your browser using DataLab