opencv matrix 类型矩阵怎么计算逆矩阵
发布网友
发布时间:2022-05-21 13:55
我来回答
共1个回答
热心网友
时间:2023-10-26 17:27
文档上的说明:
Mat::convertTo
Converts an array to another data type with optional scaling.
C++: void Mat::convertTo(OutputArray m, int rtype, double alpha=1, double beta=0 ) const
Parameters:
m – output matrix; if it does not have a proper size or type before the operation, it is reallocated.
rtype – desired output matrix type or, rather, the depth since the number of channels are the same as the input has; if rtype is negative, the output matrix will have the same type as the input.
alpha – optional scale factor.
beta – optional delta added to the scaled values.
The method converts source pixel values to the target data type.saturate_cast<> is applied at the end to avoid possible overflows:
用法:
Mat src, dst;
src.convertTo(dst, dstType)