Table of Contents

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

src InputArray

input array (single-channel, 8-bit or 32-bit floating point).

dst InputOutputArray

input/output array of the same size and type as src.

mask InputArray

optional mask; pixels outside the mask keep their original value in dst.

thresh double

threshold value.

maxval double

maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.

type ThresholdTypes

thresholding type (see the details below).

Returns

double

the computed threshold value when type == OTSU