项目需要将matlab代码写成C++,准备用opencv.opencv中矩阵的存储与matlab有所不同,应注意以下问题: 1.matlab中矩阵是按照列优先存储的.对于n0*n1*...*nn维的矩阵,具体存储方式是:(a0(0),a1(0),...,an(0)),(a0(1),a1(0),...an(0)), (a0(n0),a1(0),...an(0)),(a0(0),a1(1),a2(0),...an(0)),...(a0(0),a1(0),...,an(nn)).即先遍历a0,再遍历a