View source: R/measure_disease_byl.R
measure_disease_byl | R Documentation |
Computes the percentage of symptomatic leaf area using color palettes or RGB
indexes by
each l
eaf of an image. This allows, for example, processing
replicates of the same treatment and obtaining the results for each
replication with a single image. To do that, leaf samples are first splitten
with object_split()
and then, measure_disease()
is applied to the list of
leaves.
measure_disease_byl(
img,
index = "B",
index_lb = "B",
index_dh = "NGRDI",
lower_size = NULL,
watershed = TRUE,
invert = FALSE,
fill_hull = FALSE,
filter = 3,
threshold = "Otsu",
extension = NULL,
tolerance = NULL,
object_size = "large",
img_healthy = NULL,
img_symptoms = NULL,
plot = TRUE,
save_image = FALSE,
dir_original = NULL,
dir_processed = NULL,
pattern = NULL,
parallel = FALSE,
workers = NULL,
show_features = FALSE,
verbose = TRUE,
...
)
img |
The image to be analyzed. |
index |
A character value specifying the target mode for
conversion to binary to segment the leaves from background. Defaults to "B"
(blue). See |
index_lb |
The index used to segment the foreground (e.g., leaf) from the background. If not declared, the entire image area (pixels) will be considered in the computation of the severity. |
index_dh |
The index used to segment diseased from healthy tissues when
|
lower_size |
To prevent dust from affecting object segmentation, objects
with lesser than |
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
|
img_healthy |
A color palette of healthy tissues. |
img_symptoms |
A color palette of lesioned tissues. |
plot |
Show image after processing? |
save_image |
Save the image after processing? The image is saved in the
current working directory named as |
dir_original, dir_processed |
The directory containing the original and
processed images. Defaults to |
pattern |
A pattern of file name used to identify images to be
processed. For example, if |
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, especially when |
workers |
A positive numeric scalar or a function specifying the maximum number of parallel processes that can be active at the same time. |
show_features |
If |
verbose |
If |
... |
Additional arguments passed on to |
A list with the following objects:
severity
A data frame with the percentage of healthy and symptomatic
areas for each leaf in the image(s).
shape
,statistics
If show_features = TRUE
is used, returns the shape
(area, perimeter, etc.) for each lesion and a summary statistic of the
results.
library(pliman)
img <- image_pliman("mult_leaves.jpg", plot = TRUE)
sev <-
measure_disease_byl(img = img,
index_lb = "B",
index_dh = "NGRDI",
workers = 2)
sev$severity
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.