pub fn abs(m: &impl MatTraitConst) -> Result<MatExpr>
Expand description
Calculates an absolute value of each matrix element.
abs is a meta-function that is expanded to one of absdiff or convertScaleAbs forms:
- C = abs(A-B) is equivalent to
absdiff(A, B, C)
- C = abs(A) is equivalent to
absdiff(A, Scalar::all(0), C)
- C =
Mat_<Vec<uchar,n> >(abs(A*alpha + beta))
is equivalent toconvertScaleAbs(A, C, alpha, beta)
The output matrix has the same size and the same type as the input one except for the last case, where C is depth=CV_8U .
§Parameters
- m: matrix.
§See also
[MatrixExpressions], absdiff, convertScaleAbs