createTarget: Create a target image (RasterStack) from a polygon.

View source: R/createTarget.R

createTargetR Documentation

Create a target image (RasterStack) from a polygon.

Description

Create a target image (RasterStack) from a polygon.

Usage

createTarget(
  outline,
  image,
  res = 300,
  colorFill = "black",
  colorBG = "white",
  sigma = 10,
  plot = FALSE
)

Arguments

outline

xy coordinates that define outline.

image

Image imported as RasterStack used in the analysis. This is used to extract the extent and dimensions for the raster layers.

res

Resolution for RasterStack (default = 300).

colorFill

Color for the fill of the polygon (default = 'black').

colorBG

Color for the background (default = 'white').

sigma

Size of sigma for Gaussian blurring (default = 10).

plot

Whether to plot the created target image (default = FALSE).

Value

RasterStack

Examples


## Not run: 
outline_BC0077 <- read.table(paste(system.file("extdata",  package = 'patternize'),
'/BC0077_outline.txt', sep=''), header = FALSE)

data(imageList)

target <- createTarget(outline_BC0077, imageList[[1]], plot =  TRUE)

## End(Not run)


patternize documentation built on Aug. 22, 2023, 5:07 p.m.