pub fn apply(&self, img: &RgbImage) -> GrayImage {
        let gray = self.gleam(img);

        // Temporarily increase the image size for edge detection to work (better).
        let gray = Self::double_the_size(gray);
        let edges = self.get_edges(&gray);
        let directions = self.get_gradient_directions(&gray);

        // The grayscale image is not required anymore; we can free some memory.
        drop(gray);

        let swt = self.transform(edges, directions);

        swt
    }
/// Applies the Stroke Width Transformation to the image.
Applies the Stroke Width Transformation to the image.
Applies the Stroke Width Transformation to the image .
pub fn apply(&self, img: &RgbImage) -> GrayImage {
        let gray = self.gleam(img);
        // Temporarily increase the image size for edge detection to work (better).
        let gray = Self::double_the_size(gray);
        let edges = self.get_edges(&gray);
        let directions = self.get_gradient_directions(&gray);
        // The grayscale image is not required anymore; we can free some memory.
        drop(gray);
        let swt = self.transform(edges, directions);
        swt
    }
pub fn apply ( & self , img : & RgbImage ) -> GrayImage { let gray = self . gleam ( img ) ; // Temporarily increase the image size for edge detection to work (better). let gray = Self :: double_the_size ( gray ) ; let edges = self . get_edges ( & gray ) ; let directions = self . get_gradient_directions ( & gray ) ; // The grayscale image is not required anymore; we can free some memory. drop ( gray ) ; let swt = self . transform ( edges , directions ) ; swt }
Applies the Stroke Width Transformation to the image.
Applies the Stroke Width Transformation to the image .
&self
img
&RgbImage
&self
img
&RgbImage