image_segment {pliman} | R Documentation |
image_segment()
reduces a color, color near-infrared, or grayscale images
to a segmented image using a given color channel (red, green blue) or even
color indexes (See image_index()
for more details). The Otsu's thresholding
method (Otsu, 1979) is used to automatically perform clustering-based image
thresholding.
image_segment_iter()
Provides an iterative image segmentation, returning
the proportions of segmented pixels.
image_segment(
image,
index = NULL,
my_index = NULL,
threshold = "Otsu",
fill_hull = FALSE,
re = NULL,
nir = NULL,
invert = FALSE,
show_image = TRUE,
nrow = NULL,
ncol = NULL,
parallel = FALSE,
workers = NULL,
verbose = TRUE
)
image_segment_iter(
image,
nseg = 1,
index = NULL,
invert = NULL,
threshold = NULL,
show_image = TRUE,
verbose = TRUE,
nrow = NULL,
ncol = NULL,
parallel = FALSE,
workers = NULL,
...
)
image |
An image object or a list of image objects. |
index |
|
my_index |
User can calculate a different index using the bands names,
e.g. |
threshold |
By default ( |
fill_hull |
Fill holes in the objects? Defaults to |
re |
Respective position of the red-edge band at the original image file. |
nir |
Respective position of the near-infrared band at the original image file. |
invert |
Inverts the binary image, if desired. For
|
show_image |
Show image after processing? |
nrow , ncol |
The number of rows or columns in the plot grid. Defaults to
|
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. |
verbose |
If |
nseg |
The number of iterative segmentation steps to be performed. |
... |
Additional arguments passed on to |
image_segment()
returns list containing n
objects where n
is the
number of indexes used. Each objects contains:
image
an image with the RGB bands (layers) for the segmented object.
mask
A mask with logical values of 0 and 1 for the segmented image.
image_segment_iter()
returns a list with (1) a data frame with the
proportion of pixels in the segmented images and (2) the segmented images.
Tiago Olivoto tiagoolivoto@gmail.com
Nobuyuki Otsu, "A threshold selection method from gray-level histograms". IEEE Trans. Sys., Man., Cyber. 9 (1): 62-66. 1979. doi: 10.1109/TSMC.1979.4310076
library(pliman)
img <- image_pliman("soybean_touch.jpg", plot = TRUE)
image_segment(img, index = c("R, G, B"))