otbtex_gray: Calculates Gray scale morphological operations for a given...

Description Usage Arguments Value Note Author(s) Examples

View source: R/rs_textures.R

Description

Calculates Gray scale morphological operations for a given kernel size. return list of geotiffs containing thelocal statistics for each channel

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
otbtex_gray(
  input = NULL,
  out = "morpho",
  ram = "8192",
  filter = "dilate",
  structype = "ball",
  xradius = 5,
  yradius = 5,
  channel = NULL,
  retRaster = FALSE,
  outDir = NULL,
  verbose = FALSE,
  otbLinks = NULL
)

Arguments

input

of GeoTiff containing 1 ore more gray value bands

out

the output mono band image containing the edge features

ram

reserved memory in MB

filter

the choice of the morphological operation (dilate/erode/opening/closing) (default value is dilate)

structype

the choice of the structuring element type (ball/cross)

xradius

x the ball structuring element X Radius (only if structype==ball)

yradius

y the ball structuring element Y Radius (only if structype==ball)

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

otbLinks

list. of GI tools cli pathes

Value

raster* object

Note

the otb is used for filtering. please provide a GeoTiff file

Author(s)

Chris Reudenbach

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# 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 = "GrayScaleMorphologicalOperation",gili=otbLinks)
listviewer::jsonedit(cmd$help)

r<-otbtex_gray(input="pacman.tif",retRaster = TRUE,otbLinks=otbLinks)

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

## End(Not run)

uavRst documentation built on Dec. 30, 2019, 5:06 p.m.