object_export_shp {pliman} | R Documentation |
Export multiple objects from an image to multiple images
Description
Givin an image with multiple objects, object_export_shp()
will split the
objects into a list of objects using object_split_shp()
and then export
them to multiple images into the current working directory (or a subfolder).
Batch processing is performed by declaring a file name pattern that matches
the images within the working directory.
Usage
object_export_shp(
img,
pattern = NULL,
dir_original = NULL,
dir_processed = NULL,
format = ".jpg",
subfolder = NULL,
squarize = FALSE,
nrow = 1,
ncol = 1,
buffer_x = 0,
buffer_y = 0,
interactive = FALSE,
parallel = FALSE,
verbose = TRUE,
viewer = get_pliman_viewer()
)
Arguments
img |
An object of class |
pattern |
A pattern of file name used to identify images to be
processed. For example, if |
dir_original |
The directory containing the original images. Defaults to
|
dir_processed |
Optional character string indicating a subfolder within the current working directory to save the image(s). If the folder doesn't exist, it will be created. |
format |
The format of image to be exported. |
subfolder |
Optional character string indicating a subfolder within the current working directory to save the image(s). If the folder doesn't exist, it will be created. |
squarize |
Squarizes the image before the exportation? If |
nrow |
The number of desired rows in the grid. Defaults to |
ncol |
The number of desired columns in the grid. Defaults to |
buffer_x , buffer_y |
Buffering factor for the width and height, respectively, of each individual shape's side. A value between 0 and 0.5 where 0 means no buffering and 0.5 means complete buffering (default: 0). A value of 0.25 will buffer the shape by 25% on each side. |
interactive |
If |
parallel |
If |
verbose |
If |
viewer |
The viewer option. If not provided, the value is retrieved
using |
Value
A NULL
object.
Examples
if(interactive()){
library(pliman)
flax <- image_pliman("flax_leaves.jpg", plot = TRUE)
object_export_shp(flax)
}