Learn R Programming

uavRst (version 0.5-2)

otbtex_edge: Calculates edges for a given kernel size.

Description

Calculates edges for a given kernel size. return list of geotiffs containing thelocal statistics for each channel

Usage

otbtex_edge(input = NULL, out = "edge", ram = "8192",
  filter = "gradient", filter.touzi.xradius = 1,
  filter.touzi.yradius = 1, channel = NULL, retRaster = FALSE,
  outDir = NULL, verbose = FALSE, giLinks = NULL)

Arguments

input

of GeoTiff containing 1 ore more gray value band(s)

out

the output mono band image containing the edge features

ram

reserved memory in MB

filter

the choice of edge detection method (gradient/sobel/touzi)

filter.touzi.xradius

x radius of the Touzi processing neighborhood (if filter==touzi) (default value is 1 pixel)

filter.touzi.yradius

y radius of the Touzi processing neighborhood (if filter==touzi) (default value is 1 pixel)

channel

sequence of bands to be processed

retRaster

boolean if TRUE a raster stack is returned

outDir

output Directory

verbose

switch for system messages default is FALSE

giLinks

list. of GI tools cli pathes

Examples

Run this code
# NOT RUN {
##- required packages
require(uavRst)
require(link2GI)
setwd(tempdir())

## check if OTB exists
giLinks <- list()
giLinks$otb <- link2GI::linkOTB()

if (giLinks$otb$exist) {
data("pacman")
pacman<-raster::disaggregate(pacman,10)
raster::writeRaster(pacman,"pacman.tif",overwrite=TRUE)

##- calculate Sobel edge detection
r<-otbtex_gray(input="pacman.tif",
               filter = "erode",
               structype = "ball", 
               structype.ball.xradius = 3,
               structype.ball.yradius = 3 ,
               retRaster = TRUE)

##- visualize all layers
raster::plot(r[[1]])
}
# }

Run the code above in your browser using DataLab