opencv::gapi

Function sub_rc

source
pub fn sub_rc(
    c: &impl GScalarTraitConst,
    src: &impl GMatTraitConst,
    ddepth: i32,
) -> Result<GMat>
Expand description

Calculates the per-element difference between given scalar and the matrix.

The function can be replaced with matrix expressions: block formula

Depth of the output matrix is determined by the ddepth parameter. If ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix. The matrices can be single or multi channel. Output matrix must have the same size as src.

Supported matrix data types are [CV_8UC1], [CV_8UC3], [CV_16UC1], [CV_16SC1], [CV_32FC1].

Note: Function textual ID is “org.opencv.core.math.subRC”

§Parameters

  • c: scalar value to subtract from.
  • src: input matrix to be subtracted.
  • ddepth: optional depth of the output matrix.

§See also

add, addC, subC

§C++ default parameters

  • ddepth: -1