Function select

Source
pub fn select(
    src1: &impl GMatTraitConst,
    src2: &impl GMatTraitConst,
    mask: &impl GMatTraitConst,
) -> Result<GMat>
Expand description

Select values from either first or second of input matrices by given mask. The function set to the output matrix either the value from the first input matrix if corresponding value of mask matrix is 255, or value from the second input matrix (if value of mask matrix set to 0).

Input mask matrix must be of [CV_8UC1] type, two other inout matrices and output matrix should be of the same type. The size should be the same for all input and output matrices. Supported input matrix data types are [CV_8UC1], [CV_8UC3], [CV_16UC1], [CV_16SC1], [CV_32FC1].

Note: Function textual ID is “org.opencv.core.pixelwise.select”

§Parameters

  • src1: first input matrix.
  • src2: second input matrix.
  • mask: mask input matrix.