ZhenghaoFei/visual_odom

about the camera intrinsic matrix in the function trackingFrame2Frame() of src/visualOdometry.cpp

weiningwei opened this issue · 2 comments

Hi, thanks for sharing the code!
But I have the question about the function trackingFrame2Frame() of src/visualOdometry.cpp . In the function, your camera intrinsic matrix is :
cv::Mat intrinsic_matrix = (cv::Mat_<float>(3, 3) << projMatrl.at<float>(0, 0), projMatrl.at<float>(0, 1), projMatrl.at<float>(0, 2), projMatrl.at<float>(1, 0), projMatrl.at<float>(1, 1), projMatrl.at<float>(1, 2), projMatrl.at<float>(1, 1), projMatrl.at<float>(1, 2), projMatrl.at<float>(1, 3));
But I think the camera intrinsic matrix shuould be
fx 0 cx 0 fy cy 0 0 1.
So the matrix should be
cv::Mat intrinsic_matrix = (cv::Mat_<float>(3, 3) << projMatrl.at<float>(0, 0), projMatrl.at<float>(0, 1), projMatrl.at<float>(0, 2), projMatrl.at<float>(1, 0), projMatrl.at<float>(1, 1), projMatrl.at<float>(1, 2), projMatrl.at<float>(2, 0), projMatrl.at<float>(2,1), projMatrl.at<float>(2, 2));

Hi Weiningwei,

That's the beauty of open source! Yes, it was a bug, I changed and it seems to perform better. Does it also solve your 04 and 06 results error? I am a little bit surprised that most of the results are still good with this bug.

I fixed the bug and made a new commit. Thank you Weiningwei!