- image
File name and full path or path relative to working directory for image.
Image is converted to a SpatRaster internally.
- features
File name and full path or path relative to working directory
for vector mask or label data. A field should be provided that differentiates
classes using unique numeric codes. If the input features
use a different coordinate reference system then the input image, the features
will be reprojected to match the image. Vector data are converted to a
SpatVector object internally.
- crop
TRUE or FALSE. Whether or not to crop the input image data relative
to a defined vector extent. The default is FALSE.
- extent
File name and full path or path relative to working directory for
vector extent data. If the extent uses a different coordinate reference system
then the input image, the features will be reprojected to match the image.
Vector data are converted to a SpatVector object internally.
- field
The name of the field in the feature vector data that differentiates
classes using a unique numeric code with an integer data type. Field name should
be provided as a string.
- background
The numeric value to assign to the background class. The default
is 0. If the full spatial extent has labels in the input feature data, no background
value will be applied. For binary classification problems, the background should be
coded to 0 and the positive case should be coded to 1. It is not necessary to
include the background class in the vector feature data.
- outImage
Image output name in TIFF format (".tif") with full path or path
relative to working directory for image. This output will only be generated if
the mode is set to "Both".
- outMask
Mask output name in TIFF format (".tif") with full path or path
relative to working directory for image. Output will be a single-band raster
grid of class numeric codes.
- mode
Either "Both" or "Mask". If "Both", a copy of the image will be made
along with the generated raster mask. If "Mask", only the mask is produced. If
you are experiencing issues with alignment between the image and associated mask,
setting the mode to "Both" can alleviate this issue. However, this will result in
more data being written to disk.