# NOT RUN {
# required packages
# load libraries
require(uavRst)
require(link2GI)
require(listviewer)
setwd(tempdir())
# check if OTB exists
otbLinks <- link2GI::linkOTB()
if (otbLinks$exist) {
data("rgb")
raster::plotRGB(rgb)
fn<-file.path(tempdir(),"rgb.tif")
raster::writeRaster(rgb,
filename=fn,
format="GTiff",
overwrite=TRUE)
# get help
cmd<-link2GI::parseOTBFunction(algo = "EdgeExtraction",gili=otbLinks)
listviewer::jsonedit(cmd$help)
# calculate Sobel edge detection
r<-otbtex_edge(input=fn,
filter="sobel",
retRaster = TRUE,
otbLinks = otbLinks)
# visualize all layers
raster::plot(r[[1]])
}
# }
Run the code above in your browser using DataLab