Method ThresholdWithMask
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
ThresholdWithMask(InputArray, InputOutputArray, InputArray, double, double, ThresholdTypes)
Applies a fixed-level threshold to each array element, restricted to the pixels selected by mask.
public static double ThresholdWithMask(InputArray src, InputOutputArray dst, InputArray mask, double thresh, double maxval, ThresholdTypes type)
Parameters
srcInputArrayinput array (single-channel, 8-bit or 32-bit floating point).
dstInputOutputArrayinput/output array of the same size and type as src.
maskInputArrayoptional mask; pixels outside the mask keep their original value in dst.
threshdoublethreshold value.
maxvaldoublemaximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.
typeThresholdTypesthresholding type (see the details below).
Returns
- double
the computed threshold value when type == OTSU