View source: R/utils_objects.R
object_export | R Documentation |
Givin an image with multiple objects, object_export()
will split the
objects into a list of objects using object_split()
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.
object_export(
img,
pattern = NULL,
dir_original = NULL,
dir_processed = NULL,
format = ".jpg",
squarize = FALSE,
augment = FALSE,
times = 12,
index = "NB",
lower_size = NULL,
watershed = FALSE,
invert = FALSE,
fill_hull = FALSE,
filter = 2,
threshold = "Otsu",
extension = NULL,
tolerance = NULL,
object_size = "medium",
edge = 20,
remove_bg = FALSE,
parallel = FALSE,
verbose = TRUE
)
img |
The image to be analyzed. |
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. |
squarize |
Squarizes the image before the exportation? If |
augment |
A logical indicating if exported objects should be augmented using
|
times |
The number of times to rotate the image. |
index |
A character value specifying the target mode for conversion to
binary image when |
lower_size |
Plant images often contain dirt and dust. To prevent dust from
affecting the image analysis, objects with lesser than 10% of the mean of all objects
are removed. Set |
watershed |
If |
invert |
Inverts the binary image if desired. This is useful to process
images with a black background. Defaults to |
fill_hull |
Fill holes in the binary image? Defaults to |
filter |
Performs median filtering in the binary image? See more at
|
threshold |
The theshold method to be used.
|
extension |
Radius of the neighborhood in pixels for the detection of neighboring objects. Higher value smooths out small objects. |
tolerance |
The minimum height of the object in the units of image intensity between its highest point (seed) and the point where it contacts another object (checked for every contact pixel). If the height is smaller than the tolerance, the object will be combined with one of its neighbors, which is the highest. |
object_size |
The size of the object. Used to automatically set up
|
edge |
The number of pixels to be added in the edge of the segmented object. Defaults to 5. |
remove_bg |
If |
parallel |
If |
verbose |
If |
A NULL
object.
if(interactive()){
library(pliman)
img <- image_pliman("potato_leaves.jpg")
object_export(img,
remove_bg = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.