我尝试执行以下操作,但它在Mat referenceVectors [11]中给出了错误。为什么?
Error 3 error C2536: 'superpixels::superpixels::referenceVectors' : cannot specify explicit initializer for arrays c:\users\documents\visual studio 2013\projects\3d_reconstruction\3d_reconstruction\superpixels.h 80 1 3D_Reconstruction
我已经尝试将它放在构造函数中(此处未显示)但我仍然收到错误(不同的错误)。
class superpixels {
public:
private:
// Major vectors
Mat Lwall = (Mat_<float>(1, 3) << 1, 0, 0);
Mat Rwall = (Mat_<float>(1, 3) << -1, 0, 0);
Mat Floor = (Mat_<float>(1, 3) << 0, -1, 0);
Mat Depth = (Mat_<float>(1, 3) << 0, 0, -1);
// Intermediary vectors
Mat Lwall_Depth = (Mat_<float>(1, 3) << 0.707, 0, -0.707);
Mat Lwall_Floor = (Mat_<float>(1, 3) << 0.707, -0.707, 0);
Mat Floor_Depth = (Mat_<float>(1, 3) << 0, -0.707, -0.707);
Mat Rwall_Depth = (Mat_<float>(1, 3) << -0.707, 0, -0.707);
Mat Rwall_Floor = (Mat_<float>(1, 3) << -0.707, 0, -0.707);
Mat Lwall_Depth_Floor = (Mat_<float>(1, 3) << 0.5774, -0.5774, -0.5774);
Mat Rwall_Depth_Floor = (Mat_<float>(1, 3) << -0.5774, -0.5774, -0.5774);
// All vectors
Mat referenceVectors[11] = { Lwall, Rwall, Floor, Depth, Lwall_Depth, Lwall_Floor, Floor_Depth, Rwall_Depth, Rwall_Floor, Lwall_Depth_Floor, Rwall_Depth_Floor };
};