View source: R/utils_objects.R
object_bbox | R Documentation |
This function calculates the bounding boxes for a given list of contours.
object_bbox(contours)
contours |
A list of matrices, where each matrix contains two columns representing (x, y) coordinates of a contour. |
A list of bounding boxes, where each bounding box is represented as a
list with x_min
, y_min
, x_max
, and y_max
values.
if(interactive()){
contours <- list(
matrix(c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
110, 120, 130, 140, 150, 160, 170, 180, 190, 200),
ncol = 2, byrow = FALSE)
)
bbox_list <- object_bbox(contours)
print(bbox_list)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.