Quyền Anh
Quyền Anh

Reputation: 103

Can't access mat's data after using copyTo command

Src & dst are 3x3 cv::Mat with type 32FC1.

After copy data,

Src.col(0).copyTo(dst.col(2));
Src.col(1).copyTo(dst.col(0));
Src.col(2).copyTo(dst.col(1));

access dst data like dst.at<double>(1,1) return error.

Unhandled exception at 0x7530812f in matrix.exe: Microsoft C++ exception: cv::Exception at memory location 0x002fedc8..

Please tell me the reason.

Upvotes: 0

Views: 157

Answers (1)

PhilLab
PhilLab

Reputation: 5007

32FC1 is single precision, i.e. dst.at<float>(1,1)! So either use that or change the type to 64FC1.

Upvotes: 4

Related Questions