:param minVal: Pointer to the returned minimum value. ``NULL`` is used if not required.
:param maxVal: Pointer to the returned maximum value. ``NULL`` is used if not required.
:param minIdx: Pointer to the returned minimum location (in nD case). ``NULL`` is used if not required. Otherwise, it must point to an array of ``src.dims`` elements. The coordinates of the minimum element in each dimension are stored there sequentially.
.. note::
When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-row matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-column matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``).
:param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required.
The function ``minMaxIdx`` 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 does not work with multi-channel arrays. If you need to find minimum or maximum elements across all the channels, use
:ocv:func:`Mat::reshape` first to reinterpret the array as single-channel. Or you may extract the particular channel using either
:ocv:func:`extractImageCOI` , or
:ocv:func:`mixChannels` , or
:ocv:func:`split` .
In case of a sparse matrix, the minimum is found among non-zero elements only.
minMaxLoc
---------
Finds the global minimum and maximum in a whole array or sub-array.
@@ -1779,10 +1810,6 @@ Finds the global minimum and maximum in a whole array or sub-array.
:param maxLoc: Pointer to the returned maximum location (in 2D case). ``NULL`` is used if not required.
:param minIdx: Pointer to the returned minimum location (in nD case). ``NULL`` is used if not required. Otherwise, it must point to an array of ``src.dims`` elements. The coordinates of the minimum element in each dimension are stored there sequentially.
:param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required.
:param mask: Optional mask used to select a sub-array.
The functions ``minMaxLoc`` find the minimum and maximum element values and their positions. The extremums are searched across the whole array or,
...
...
@@ -1794,8 +1821,6 @@ The functions do not work with multi-channel arrays. If you need to find minimum
:ocv:func:`mixChannels` , or
:ocv:func:`split` .
In case of a sparse matrix, the minimum is found among non-zero elements only.