why does A is4*4 or not 6*4
up vote
-2
down vote
favorite
recently I'm studying ORB_SLAM2
.In the open source code,I find the code that put on this page. I have a question about that,why dose the matrix A only have 4*4
dimension,I think it should have 6*4
dimension.Because,it is from two matrix of multiply.[kp1.pt.x,kp1.pt.y]*P1
?
Triangulate(const cv::KeyPoint &kp1, const cv::KeyPoint &kp2,const cv::Mat &P1, const cv::Mat &P2, cv::Mat &x3D)
cv::Mat A(4,4,CV_32F);
A.row(0) = kp1.pt.x*P1.row(2)-P1.row(0);
A.row(1) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(2) = kp2.pt.x*P2.row(2)-P2.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
cv::Mat u,w,vt;
cv::SVD::compute(A,w,u,vt,cv::SVD::MODIFY_A
//I think the matrix A from triangulation should do is in the beneth
A.row(0) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(1) = P1.row(0)-kp1.pt.x*P1.row(2);
A.row(2) = kp1.pt.x*P1.row(1)-kp1.pt.y*P1.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
A.row(4) = P2.row(0)-kp2.pt.x*P2.row(2);
A.row(5) = kp2.pt.x*P2.row(1)-kp2.pt.y*P2.row(0);
I mainly doubt the dimension of matrix A how to initialize! 4*4 or 6*4 ??
opencv triangulation
New contributor
add a comment |
up vote
-2
down vote
favorite
recently I'm studying ORB_SLAM2
.In the open source code,I find the code that put on this page. I have a question about that,why dose the matrix A only have 4*4
dimension,I think it should have 6*4
dimension.Because,it is from two matrix of multiply.[kp1.pt.x,kp1.pt.y]*P1
?
Triangulate(const cv::KeyPoint &kp1, const cv::KeyPoint &kp2,const cv::Mat &P1, const cv::Mat &P2, cv::Mat &x3D)
cv::Mat A(4,4,CV_32F);
A.row(0) = kp1.pt.x*P1.row(2)-P1.row(0);
A.row(1) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(2) = kp2.pt.x*P2.row(2)-P2.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
cv::Mat u,w,vt;
cv::SVD::compute(A,w,u,vt,cv::SVD::MODIFY_A
//I think the matrix A from triangulation should do is in the beneth
A.row(0) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(1) = P1.row(0)-kp1.pt.x*P1.row(2);
A.row(2) = kp1.pt.x*P1.row(1)-kp1.pt.y*P1.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
A.row(4) = P2.row(0)-kp2.pt.x*P2.row(2);
A.row(5) = kp2.pt.x*P2.row(1)-kp2.pt.y*P2.row(0);
I mainly doubt the dimension of matrix A how to initialize! 4*4 or 6*4 ??
opencv triangulation
New contributor
2
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
code editing done
– Amit Ray
yesterday
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago
add a comment |
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
recently I'm studying ORB_SLAM2
.In the open source code,I find the code that put on this page. I have a question about that,why dose the matrix A only have 4*4
dimension,I think it should have 6*4
dimension.Because,it is from two matrix of multiply.[kp1.pt.x,kp1.pt.y]*P1
?
Triangulate(const cv::KeyPoint &kp1, const cv::KeyPoint &kp2,const cv::Mat &P1, const cv::Mat &P2, cv::Mat &x3D)
cv::Mat A(4,4,CV_32F);
A.row(0) = kp1.pt.x*P1.row(2)-P1.row(0);
A.row(1) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(2) = kp2.pt.x*P2.row(2)-P2.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
cv::Mat u,w,vt;
cv::SVD::compute(A,w,u,vt,cv::SVD::MODIFY_A
//I think the matrix A from triangulation should do is in the beneth
A.row(0) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(1) = P1.row(0)-kp1.pt.x*P1.row(2);
A.row(2) = kp1.pt.x*P1.row(1)-kp1.pt.y*P1.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
A.row(4) = P2.row(0)-kp2.pt.x*P2.row(2);
A.row(5) = kp2.pt.x*P2.row(1)-kp2.pt.y*P2.row(0);
I mainly doubt the dimension of matrix A how to initialize! 4*4 or 6*4 ??
opencv triangulation
New contributor
recently I'm studying ORB_SLAM2
.In the open source code,I find the code that put on this page. I have a question about that,why dose the matrix A only have 4*4
dimension,I think it should have 6*4
dimension.Because,it is from two matrix of multiply.[kp1.pt.x,kp1.pt.y]*P1
?
Triangulate(const cv::KeyPoint &kp1, const cv::KeyPoint &kp2,const cv::Mat &P1, const cv::Mat &P2, cv::Mat &x3D)
cv::Mat A(4,4,CV_32F);
A.row(0) = kp1.pt.x*P1.row(2)-P1.row(0);
A.row(1) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(2) = kp2.pt.x*P2.row(2)-P2.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
cv::Mat u,w,vt;
cv::SVD::compute(A,w,u,vt,cv::SVD::MODIFY_A
//I think the matrix A from triangulation should do is in the beneth
A.row(0) = kp1.pt.y*P1.row(2)-P1.row(1);
A.row(1) = P1.row(0)-kp1.pt.x*P1.row(2);
A.row(2) = kp1.pt.x*P1.row(1)-kp1.pt.y*P1.row(0);
A.row(3) = kp2.pt.y*P2.row(2)-P2.row(1);
A.row(4) = P2.row(0)-kp2.pt.x*P2.row(2);
A.row(5) = kp2.pt.x*P2.row(1)-kp2.pt.y*P2.row(0);
I mainly doubt the dimension of matrix A how to initialize! 4*4 or 6*4 ??
opencv triangulation
opencv triangulation
New contributor
New contributor
edited 18 hours ago
New contributor
asked yesterday
Kai
12
12
New contributor
New contributor
2
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
code editing done
– Amit Ray
yesterday
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago
add a comment |
2
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
code editing done
– Amit Ray
yesterday
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago
2
2
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
code editing done
– Amit Ray
yesterday
code editing done
– Amit Ray
yesterday
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Kai is a new contributor. Be nice, and check out our Code of Conduct.
Kai is a new contributor. Be nice, and check out our Code of Conduct.
Kai is a new contributor. Be nice, and check out our Code of Conduct.
Kai is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53226676%2fwhy-does-a-is44-or-not-64%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Please use the edit button and 1) include the code into the question, 2) try to be more clear
– Miki
yesterday
code editing done
– Amit Ray
yesterday
I have put the code under question, Thank you for mentioning.
– Kai
18 hours ago
can you change the evaluation please.
– Kai
18 hours ago