Function opencv::core::in_range

source ·
pub fn in_range(
    src: &impl ToInputArray,
    lowerb: &impl ToInputArray,
    upperb: &impl ToInputArray,
    dst: &mut impl ToOutputArray
) -> Result<()>
Expand description

Checks if array elements lie between the elements of two other arrays.

The function checks the range as follows:

  • For every element of a single-channel input array: block formula
  • For two-channel arrays: block formula
  • and so forth.

That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the specified 1D, 2D, 3D, … box and 0 otherwise.

When the lower and/or upper boundary parameters are scalars, the indexes (I) at lowerb and upperb in the above formulas should be omitted.

Parameters

  • src: first input array.
  • lowerb: inclusive lower boundary array or a scalar.
  • upperb: inclusive upper boundary array or a scalar.
  • dst: output array of the same size as src and CV_8U type.