cont <- contours[[2]]
plot_polygon(cont |> conv_hull() |> poly_align())
# width below 5th, 25th, 50th, 75th, and 95th percentiles of the length
wd <- poly_width_at(cont)
wd
# width along the height
poly_width_at(cont, at = "height", plot = TRUE)
Run the code above in your browser using DataLab