pub fn threshold_def(
src: &impl ToInputArray,
dst: &mut impl ToOutputArray,
thresh: f64,
maxval: f64,
typ: i32,
) -> Result<f64>Expand description
Applies a fixed-level threshold to each array element.
The special value cv::THRESH_OTSU may be combined with one of the other types. In this case, the function determines the optimal threshold value using the Otsu’s and uses it instead of the specified threshold. The function returns the computed threshold value in addititon to the thresholded matrix. The Otsu’s method is implemented only for 8-bit matrices.
§Parameters
- src: Source array (single-channel).
- dst: Destination array with the same size and type as src.
- thresh: Threshold value.
- maxval: Maximum value to use with THRESH_BINARY and THRESH_BINARY_INV threshold types.
- type: Threshold type. For details, see threshold. The THRESH_TRIANGLE threshold type is not supported.
- stream: Stream for the asynchronous version.
§See also
threshold
§Note
This alternative version of threshold function uses the following default values for its arguments:
- stream: Stream::Null()