View source: R/utils_objects.R
object_split | R Documentation |
Using threshold-based segmentation, objects are first isolated from background. Then, a new image is created for each single object. A list of images is returned.
object_split(
img,
index = "NB",
lower_size = NULL,
watershed = TRUE,
invert = FALSE,
fill_hull = FALSE,
filter = 2,
threshold = "Otsu",
extension = NULL,
tolerance = NULL,
object_size = "medium",
edge = 3,
remove_bg = FALSE,
plot = TRUE,
verbose = TRUE,
...
)
img |
The image to be analyzed. |
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 |
plot |
Show image after processing? |
verbose |
If |
... |
Additional arguments passed on to |
A list of objects of class Image
.
analyze_objects()
, image_binary()
library(pliman)
img <- image_pliman("la_leaves.jpg", plot = TRUE)
imgs <- object_split(img) # set to NULL to use 50% of the cores
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.