[][src]Function opencv::core::min_max_loc

pub fn min_max_loc(
    src: &dyn ToInputArray,
    min_val: &mut f64,
    max_val: &mut f64,
    min_loc: &mut Point,
    max_loc: &mut Point,
    mask: &dyn ToInputArray
) -> Result<()>

Finds the global minimum and maximum in an array.

The function cv::minMaxLoc finds the minimum and maximum element values and their positions. The extremums are searched across the whole array or, if mask is not an empty array, in the specified array region.

The function do not work with multi-channel arrays. If you need to find minimum or maximum elements across all the channels, use Mat::reshape first to reinterpret the array as single-channel. Or you may extract the particular channel using either extractImageCOI , or mixChannels , or split .

Parameters

  • src: input single-channel array.
  • minVal: pointer to the returned minimum value; NULL is used if not required.
  • maxVal: pointer to the returned maximum value; NULL is used if not required.
  • minLoc: pointer to the returned minimum location (in 2D case); NULL is used if not required.
  • maxLoc: pointer to the returned maximum location (in 2D case); NULL is used if not required.
  • mask: optional mask used to select a sub-array.

See also

max, min, compare, inRange, extractImageCOI, mixChannels, split, Mat::reshape

C++ default parameters

  • max_val: 0
  • min_loc: 0
  • max_loc: 0
  • mask: noArray()