pub fn from_image(image: &GrayImage, center_x: u8, center_y: u8) -> Self {
        assert!(
            image.width() < 512,
            "the input image must be at most 511 pixels wide"
        );
        assert!(
            image.height() < 512,
            "the input image must be at most 511 pixels high"
        );
        let center = Point::new(center_x, center_y).to_i16();
        let elements = image
            .enumerate_pixels()
            .filter(|(_, _, &p)| p[0] != 0)
            .map(|(x, y, _)| Point::new(x, y).to_i16())
            .map(|p| p - center)
            .collect();
        Self::new(elements)
    }
Creates a mask containing the points `(x, y) - (center_x, center_y)` for each `(x, y)` with non-zero intensity in `image`.

Mask contents are represented using signed integers, so `(center_x, center_y)` is not required to be within bounds for `image`. However, `image`
is restricted to have a side length of at most 511 pixels.

# Panics
If `image.width() >= 512` or `image.height() >= 512`.
src/morphology.rs