View source: R/utils_segmentation.R
object_label | R Documentation |
All pixels for each connected set of foreground (non-zero) pixels in x are
set to an unique increasing integer, starting from 1. Hence, max(x) gives the
number of connected objects in x. This is a wrapper to EBImage::bwlabel or
EBImage::watershed (if watershed = TRUE
).
object_label(
img,
index = "B",
invert = FALSE,
fill_hull = FALSE,
threshold = "Otsu",
k = 0.1,
windowsize = NULL,
filter = FALSE,
watershed = FALSE,
tolerance = NULL,
extension = NULL,
object_size = "medium",
plot = TRUE,
ncol = NULL,
nrow = NULL,
verbose = TRUE
)
img |
An image object. |
index |
A character value (or a vector of characters) specifying the
target mode for conversion to binary image. See the available indexes with
|
invert |
Inverts the binary image, if desired. |
fill_hull |
Fill holes in the objects? Defaults to |
threshold |
The theshold method to be used.
|
k |
a numeric in the range 0-1. when |
windowsize |
windowsize controls the number of local neighborhood in
adaptive thresholding. By default it is set to |
filter |
Performs median filtering in the binary image? (Defaults to
|
watershed |
If |
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. |
extension |
Radius of the neighborhood in pixels for the detection of neighboring objects. Higher value smooths out small objects. |
object_size |
The size of the object. Used to automatically set up
|
plot |
Show image after processing? |
nrow, ncol |
The number of rows or columns in the plot grid. Defaults to
|
verbose |
If |
A list with the same length of img
containing the labeled objects.
img <- image_pliman("soybean_touch.jpg")
# segment the objects using the "B" (blue) band.
object_label(img, index = "B")
object_label(img, index = "B", watershed = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.