Skip to main content

spatial_gradient_u8

Function spatial_gradient_u8 

Source
pub fn spatial_gradient_u8(
    input: ImageView<'_, u8, 1>,
    border: BorderMode<u8, 1>,
) -> VisionResult<(Image<i16, 1>, Image<i16, 1>)>
Expand description

Computes exact 3×3 Sobel X/Y gradients together for grayscale u8 input.

This matches OpenCV spatialGradient: outputs are signed i16, the two first derivatives share one source traversal, and only replicated or Reflect101 borders are accepted. CPU storage remains caller-owned and no device transfer is performed.