utils_objects | R Documentation |
object_id()
get the object identification in an image.
object_coord()
get the object coordinates and (optionally) draw a
bounding rectangle around multiple objects in an image.
object_contour()
returns the coordinates (x
and y
) for the contours
of each object in the image.
object_isolate()
isolates an object from an image.
object_coord(
img,
id = NULL,
index = "NB",
watershed = TRUE,
invert = FALSE,
filter = FALSE,
fill_hull = FALSE,
threshold = "Otsu",
edge = 2,
extension = NULL,
tolerance = NULL,
object_size = "medium",
parallel = FALSE,
workers = NULL,
plot = TRUE
)
object_contour(
img,
pattern = NULL,
dir_original = NULL,
center = FALSE,
index = "NB",
invert = FALSE,
filter = FALSE,
fill_hull = FALSE,
threshold = "Otsu",
watershed = TRUE,
extension = NULL,
tolerance = NULL,
object_size = "medium",
parallel = FALSE,
workers = NULL,
plot = TRUE,
verbose = TRUE
)
object_isolate(img, id = NULL, parallel = FALSE, workers = NULL, ...)
object_id(img, parallel = FALSE, workers = NULL, ...)
img |
An image of class |
id |
|
index |
The index to produce a binary image used to compute bounding
rectangle coordinates. See |
watershed |
If |
invert |
Inverts the binary image, if desired. Defaults to |
filter |
Performs median filtering in the binary image? See more at
|
fill_hull |
Fill holes in the objects? Defaults to |
threshold |
By default ( |
edge |
The number of pixels in the edge of the bounding rectangle.
Defaults to |
extension, tolerance, object_size |
Controls the watershed segmentation of
objects in the image. See |
parallel |
Processes the images asynchronously (in parallel) in separate
R sessions running in the background on the same machine. It may speed up
the processing time when |
workers |
A positive numeric scalar or a function specifying the maximum number of parallel processes that can be active at the same time. |
plot |
Shows the image with bounding rectangles? Defaults to
|
pattern |
A pattern of file name used to identify images to be imported.
For example, if |
dir_original |
The directory containing the original images. Defaults
to |
center |
If |
verbose |
If |
... |
|
object_id()
An image of class "Image"
containing the object's
identification.
object_coord()
A list with the coordinates for the bounding rectangles.
If id = "all"
or a numeric vector, a list with a vector of coordinates is
returned.
object_isolate()
An image of class "Image"
containing the isolated
object.
library(pliman)
img <- image_pliman("la_leaves.jpg")
# Get the object's (leaves) identification
object_id(img)
# Get the coordinates and draw a bounding rectangle around leaves 1 and 3
object_coord(img, id = c(1, 3))
# Isolate leaf 3
isolated <- object_isolate(img, id = 3)
plot(isolated)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.