我正在尝试在我的代码中计算协方差矩阵,但这样做时出现错误。我有要使用的平均值数组。这是我的代码
Mat Zt(Z);
Mat Zttranspose;
Mat covarZ=cvCreateMat(image->nChannels,image->nChannels,CV_32FC1);
Zttranspose=Zt.t();
Mat_<float> arraymean=(Mat_<float>(3,3)<< meanb, meang, meanr);
calcCovarMatrix(Zt,covarZ,arraymean,CV_COVAR_USE_AVG,CV_64F)
但我收到以下错误:
OpenCV Error: Assertion failed (((flags & CV_COVAR_ROWS) != 0) ^ ((flags & CV_COVAR_COLS) != 0)) in calcCovarMatrix, file /usr/local/src/OpenCV-2.3.0/modules/core/src/matmul.cpp, line 2127 terminate called after throwing an instance of 'cv::Exception'