错误:'operator *'不匹配(操作数类型为'cv :: MatCommaInit ializer_ <float>')

时间:2018-03-15 02:35:39

标签: c++ arrays pointers

编译期间遇到以下错误。为什么指针引用不起作用?

error: no match for ‘operator*’ (operand type is ‘cv::MatCommaInit
ializer_<float>’)
     KF.transitionMatrix = *(Mat_<float>(6, 6) <<

代码段:

void Tracking::kalman_xyz_init()
{
    const int stateNum = 6;
    const int measureNum = 3;
    KF = KalmanFilter(stateNum, measureNum, 0);
    state = cv::Mat(stateNum, 1, CV_32FC1); //state(x,y,z, detaX,detaY,detaZ)

    measurement = Mat::zeros(measureNum, 1, CV_32F);
    prediction = Mat::zeros(measureNum, 1, CV_32F);
    randn( state, Scalar::all(0), Scalar::all(0.1) );
    KF.transitionMatrix = *(Mat_<float>(6, 6) <<
                            1,0,0,1,0,0,
                            0,1,0,0,1,0,
                            0,0,1,0,0,1,
                            0,0,0,1,0,0,
                            0,0,0,0,1,0,
                            0,0,0,0,0,1  );
}  

0 个答案:

没有答案