opencv::gapi

Function sub_c_def

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

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

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.subC”

§Parameters

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

§See also

add, addC, subRC

§Note

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

  • ddepth: -1