mul

Function mul 

Source
pub fn mul(
    src1: &impl GMatTraitConst,
    src2: &impl GMatTraitConst,
    scale: f64,
    ddepth: i32,
) -> Result<GMat>
Expand description

Calculates the per-element scaled product of two matrices.

The function mul calculates the per-element product of two matrices:

block formula

If src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have the same depth as the input matrices. The matrices can be single or multi channel. Output matrix must have the same size as input matrices.

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

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

§Parameters

  • src1: first input matrix.
  • src2: second input matrix of the same size and the same depth as src1.
  • scale: optional scale factor.
  • ddepth: optional depth of the output matrix.

§See also

add, sub, div, addWeighted

§C++ default parameters

  • scale: 1.0
  • ddepth: -1