pub fn polygon(
width: usize,
height: usize,
polygon: &Vec<(f64, f64)>,
options: (Kind, Device)
) -> TensorExpand description
Generate a mask from a polygon using the scaning method
Arguments
width - The width of the image height - The height of the image polygon - The polygon 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)