pub fn trace(mtx: &impl ToInputArray) -> Result<Scalar>
Returns the trace of a matrix.
The function cv::trace returns the sum of the diagonal elements of the matrix mtx .