measure_disease_shp | R Documentation |
This function calls measure_disease()
in each image polygon of a shapefile
object generated with image_shp()
and bind the results into read-ready data
frames.
measure_disease_shp(
img,
nrow = 1,
ncol = 1,
buffer_x = 0,
buffer_y = 0,
prepare = FALSE,
viewer = "mapview",
index_lb = "HUE2",
index_dh = "NGRDI",
pattern = NULL,
threshold = NULL,
invert = FALSE,
dir_original = NULL,
show_features = FALSE,
interactive = FALSE,
plot = TRUE,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
...
)
img |
The image to be analyzed. Either an image of class |
nrow, ncol |
The number of rows and columns to generate the shapefile.
Defaults to |
buffer_x, buffer_y |
Buffering factor for the width and height, respectively, of each individual shape's side. A value between 0 and 0.5 where 0 means no buffering and 0.5 means complete buffering (default: 0). A value of 0.25 will buffer the shape by 25% on each side. |
prepare |
Logical value indicating whether to prepare the image for
analysis using |
viewer |
The viewer option. If not provided, the value is retrieved
using |
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
|
pattern |
A pattern of file name used to identify images to be
processed. For example, if |
threshold |
By default ( |
invert |
Inverts the binary image if desired. This is useful to process
images with black background. Defaults to |
dir_original |
The directory containing the original and processed images.
Defaults to |
show_features |
If |
interactive |
If |
plot |
Show image after processing? 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, 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. |
verbose |
If |
... |
Aditional arguments passed on to measure_disease. |
An object of class plm_disease_byl
. See more details in the Value
section of measure_disease()
.
if(interactive()){
# severity for the three leaflets (from left to right)
img <- image_pliman("mult_leaves.jpg", plot = TRUE)
sev <-
measure_disease_shp(img = img,
nrow = 1,
ncol = 3,
index_lb = "B",
index_dh = "NGRDI")
sev$severity
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.