opencv::imgproc

Function spatial_gradient_def

Source
pub fn spatial_gradient_def(
    src: &impl ToInputArray,
    dx: &mut impl ToOutputArray,
    dy: &mut impl ToOutputArray,
) -> Result<()>
Expand description

Calculates the first order image derivative in both x and y using a Sobel operator

Equivalent to calling:

Sobel( src, dx, CV_16SC1, 1, 0, 3 );
Sobel( src, dy, CV_16SC1, 0, 1, 3 );

§Parameters

  • src: input image.
  • dx: output image with first-order derivative in x.
  • dy: output image with first-order derivative in y.
  • ksize: size of Sobel kernel. It must be 3.
  • borderType: pixel extrapolation method, see #BorderTypes. Only #BORDER_DEFAULT=[BORDER_REFLECT_101] and [BORDER_REPLICATE] are supported.

§See also

Sobel

§Note

This alternative version of spatial_gradient function uses the following default values for its arguments:

  • ksize: 3
  • border_type: BORDER_DEFAULT