View source: R/analyze_objects_minimal.R
analyze_objects_minimal | R Documentation |
A lighter option to analyze_objects()
analyze_objects_minimal(
img,
segment_objects = TRUE,
reference = FALSE,
reference_area = NULL,
back_fore_index = "R/(G/B)",
fore_ref_index = "B-R",
reference_larger = FALSE,
reference_smaller = FALSE,
pattern = NULL,
parallel = FALSE,
workers = NULL,
watershed = TRUE,
fill_hull = FALSE,
opening = FALSE,
closing = FALSE,
filter = FALSE,
invert = FALSE,
object_size = "medium",
index = "NB",
r = 1,
g = 2,
b = 3,
re = 4,
nir = 5,
threshold = "Otsu",
tolerance = NULL,
extension = NULL,
lower_noise = 0.1,
lower_size = NULL,
upper_size = NULL,
topn_lower = NULL,
topn_upper = NULL,
lower_eccent = NULL,
upper_eccent = NULL,
lower_circ = NULL,
upper_circ = NULL,
plot = TRUE,
show_original = TRUE,
show_contour = TRUE,
contour_col = "red",
contour_size = 1,
col_foreground = NULL,
col_background = NULL,
marker = FALSE,
marker_col = NULL,
marker_size = NULL,
save_image = FALSE,
prefix = "proc_",
dir_original = NULL,
dir_processed = NULL,
verbose = TRUE
)
## S3 method for class 'anal_obj_minimal'
plot(
x,
which = "measure",
measure = "area",
type = c("density", "histogram"),
...
)
## S3 method for class 'anal_obj_ls_minimal'
plot(
x,
which = "measure",
measure = "area",
type = c("density", "histogram"),
...
)
img |
The image to be analyzed. |
segment_objects |
Segment objects in the image? Defaults to |
reference |
Logical to indicate if a reference object is present in the image. This is useful to adjust measures when images are not obtained with standard resolution (e.g., field images). See more in the details section. |
reference_area |
The known area of the reference objects. The measures of all the objects in the image will be corrected using the same unit of the area informed here. |
back_fore_index |
A character value to indicate the index to segment the
foreground (objects and reference) from the background. Defaults to
|
fore_ref_index |
A character value to indicate the index to segment
objects and the reference object. It can be either an available index in
|
reference_larger , reference_smaller |
Logical argument indicating when the
larger/smaller object in the image must be used as the reference object.
This only is valid when |
pattern |
A pattern of file name used to identify images to be imported.
For example, if |
parallel |
If |
workers |
A positive numeric scalar or a function specifying the number of parallel processes that can be active at the same time. By default, the number of sections is set up to 30% of available cores. |
watershed |
If |
fill_hull |
Fill holes in the binary image? Defaults to |
opening , closing , filter |
Morphological operations (brush size)
Hierarchically, the operations are performed as opening > closing > filter. The value declared in each argument will define the brush size. |
invert |
Inverts the binary image if desired. This is useful to process
images with a black background. Defaults to |
object_size |
The size of the object. Used to automatically set up
|
index |
A character value specifying the target mode for conversion to
binary image when |
r , g , b , re , nir |
The red, green, blue, red-edge, and near-infrared bands of the image, respectively. Defaults to 1, 2, 3, 4, and 5, respectively. If a multispectral image is provided (5 bands), check the order of bands, which are frequently presented in the 'BGR' format. |
threshold |
The theshold method to be used.
|
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. |
lower_noise |
To prevent noise from affecting the image analysis, objects
with lesser than 10% of the mean area of all objects are removed
( |
lower_size , upper_size |
Lower and upper limits for size for the image
analysis. Plant images often contain dirt and dust. Upper limit is set to
|
topn_lower , topn_upper |
Select the top |
lower_eccent , upper_eccent , lower_circ , upper_circ |
Lower and upper limit
for object eccentricity/circularity for the image analysis. Users may use
these arguments to remove objects such as square papers for scale (low
eccentricity) or cut petioles (high eccentricity) from the images. Defaults
to |
plot |
Show image after processing? |
show_original |
Show the count objects in the original image? |
show_contour |
Show a contour line around the objects? Defaults to
|
contour_col , contour_size |
The color and size for the contour line around
objects. Defaults to |
col_foreground , col_background |
Foreground and background color after
image processing. Defaults to |
marker , marker_col , marker_size |
The type, color and size of the object
marker. Defaults to |
save_image |
Save the image after processing? The image is saved in the
current working directory named as |
prefix |
The prefix to be included in the processed images. Defaults to
|
dir_original , dir_processed |
The directory containing the original and
processed images. Defaults to |
verbose |
If |
x |
An object of class |
which |
Which to plot. Either 'measure' (object measures) or 'index'
(object index). Defaults to |
measure |
The measure to plot. Defaults to |
type |
The type of plot. Either |
... |
Depends on the function:
|
Tiago Olivoto tiagoolivoto@gmail.com
library(pliman)
img <- image_pliman("soybean_touch.jpg")
obj <- analyze_objects(img)
obj$statistics
library(pliman)
img <- image_pliman("soy_green.jpg")
# Segment the foreground (grains) using the normalized blue index (NB, default)
# Shows the average value of the blue index in each object
rgb <- analyze_objects_minimal(img)
# density of area
plot(rgb)
# histogram of area
plot(rgb, type = "histogram") # or 'hist'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.