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 ??










share|improve this question









New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 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














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 ??










share|improve this question









New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 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












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 ??










share|improve this question









New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 18 hours ago





















New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Kai

12




12




New contributor




Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Kai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 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




    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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Kai is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















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



































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.









 

draft saved


draft discarded


















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.













 


draft saved


draft discarded














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














































































Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党