object_map | R Documentation |
Computes distances between objects in an anal_obj
object and returns a list
of distances, coefficient of variation (CV), and means.
object_map(object, by_column = "img", direction = c("horizontal", "vertical"))
object |
An |
by_column |
The column name in the object's results data frame to group objects by. Default is "img". |
direction |
The direction of mapping. Should be one of "horizontal" or "vertical". Default is "horizontal". |
A list with the following components:
distances |
A list of distances between objects grouped by unique values in the specified column/row. |
cvs |
A vector of coefficient of variation (CV) values for each column/row. |
means |
A vector of mean distances for each column/row. |
analyze_objects_shp
if(interactive()){
library(pliman)
flax <- image_pliman("flax_leaves.jpg", plot =TRUE)
res <-
analyze_objects_shp(flax,
nrow = 3,
ncol = 1,
watershed = FALSE,
index = "R/(G/B)",
plot = FALSE)
plot(res$final_image_mask)
plot(res$shapefiles)
# distance from each leave within each row
result <- object_map(res)
result$distances
result$cvs
result$means
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.