Function tch_utils::shapes::convex_hull
source · pub fn convex_hull(
width: usize,
height: usize,
points: &Vec<(f64, f64)>,
options: (Kind, Device)
) -> TensorExpand description
Generate a mask of the convex hull of a set of points
Arguments
width - The width of the image height - The height of the image points - The points to generate the mask from coordinates in the form of [(x1, y1), (x2, y2), …] where [0, 0] is the center of the image and the coordinates are in pixels options - The kind and device to cast the mask to
Warning: This function can cause a deadlock when called in a rayon thread that uses Mutex. (if the rayon feature is enabled)