Perspective projection plane, calculating squares on the plane












0












$begingroup$


Let's say I have a road I'm looking at from the top, have a square on it.
Then I have a different location from which I look at the road, the square now is a convex quadrilateral.



https://i.imgur.com/VfKch8R.png



I have a square shaped texture I want to put inside this quadrilateral (which is a square with perspective distortion), I can use this method and it works perfectly : Finding the Transform matrix from 4 projected points (with Javascript)



Now if I have an image of a road and I select the edges of the quadrilateral on it to determine a perspective plane.
How can I calculate the perspective projection of squares I draw onto the other sides of the image? The oculus point is not known.
https://i.imgur.com/QhK5mNi.png



For the plane's equation I should be able to use any 3 edge points of the quadrilateral, where: based on the other post's step 6, I compute (x,y,z) of these points.



From there on I am very confused how to and what to do, mostly because I can't imagine how things would look.



Maybe it has to do something with rotation of the plane, which if not related would still be nice to know, because I draw the initial square based on a vector and rotate the texture accordingly, with a downwards looking vector it will look like this and I want to correct it (ignore the diagonals, also the arrow is not perfectly centered) https://i.imgur.com/IMftDpW.png










share|cite|improve this question











$endgroup$












  • $begingroup$
    What do you mean by “the other sides of the image?”
    $endgroup$
    – amd
    Jan 23 at 20:48










  • $begingroup$
    Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
    $endgroup$
    – Krend
    Jan 23 at 21:36












  • $begingroup$
    Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
    $endgroup$
    – amd
    Jan 23 at 23:17










  • $begingroup$
    Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
    $endgroup$
    – Krend
    Jan 24 at 8:23










  • $begingroup$
    Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
    $endgroup$
    – Krend
    Jan 24 at 9:14
















0












$begingroup$


Let's say I have a road I'm looking at from the top, have a square on it.
Then I have a different location from which I look at the road, the square now is a convex quadrilateral.



https://i.imgur.com/VfKch8R.png



I have a square shaped texture I want to put inside this quadrilateral (which is a square with perspective distortion), I can use this method and it works perfectly : Finding the Transform matrix from 4 projected points (with Javascript)



Now if I have an image of a road and I select the edges of the quadrilateral on it to determine a perspective plane.
How can I calculate the perspective projection of squares I draw onto the other sides of the image? The oculus point is not known.
https://i.imgur.com/QhK5mNi.png



For the plane's equation I should be able to use any 3 edge points of the quadrilateral, where: based on the other post's step 6, I compute (x,y,z) of these points.



From there on I am very confused how to and what to do, mostly because I can't imagine how things would look.



Maybe it has to do something with rotation of the plane, which if not related would still be nice to know, because I draw the initial square based on a vector and rotate the texture accordingly, with a downwards looking vector it will look like this and I want to correct it (ignore the diagonals, also the arrow is not perfectly centered) https://i.imgur.com/IMftDpW.png










share|cite|improve this question











$endgroup$












  • $begingroup$
    What do you mean by “the other sides of the image?”
    $endgroup$
    – amd
    Jan 23 at 20:48










  • $begingroup$
    Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
    $endgroup$
    – Krend
    Jan 23 at 21:36












  • $begingroup$
    Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
    $endgroup$
    – amd
    Jan 23 at 23:17










  • $begingroup$
    Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
    $endgroup$
    – Krend
    Jan 24 at 8:23










  • $begingroup$
    Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
    $endgroup$
    – Krend
    Jan 24 at 9:14














0












0








0





$begingroup$


Let's say I have a road I'm looking at from the top, have a square on it.
Then I have a different location from which I look at the road, the square now is a convex quadrilateral.



https://i.imgur.com/VfKch8R.png



I have a square shaped texture I want to put inside this quadrilateral (which is a square with perspective distortion), I can use this method and it works perfectly : Finding the Transform matrix from 4 projected points (with Javascript)



Now if I have an image of a road and I select the edges of the quadrilateral on it to determine a perspective plane.
How can I calculate the perspective projection of squares I draw onto the other sides of the image? The oculus point is not known.
https://i.imgur.com/QhK5mNi.png



For the plane's equation I should be able to use any 3 edge points of the quadrilateral, where: based on the other post's step 6, I compute (x,y,z) of these points.



From there on I am very confused how to and what to do, mostly because I can't imagine how things would look.



Maybe it has to do something with rotation of the plane, which if not related would still be nice to know, because I draw the initial square based on a vector and rotate the texture accordingly, with a downwards looking vector it will look like this and I want to correct it (ignore the diagonals, also the arrow is not perfectly centered) https://i.imgur.com/IMftDpW.png










share|cite|improve this question











$endgroup$




Let's say I have a road I'm looking at from the top, have a square on it.
Then I have a different location from which I look at the road, the square now is a convex quadrilateral.



https://i.imgur.com/VfKch8R.png



I have a square shaped texture I want to put inside this quadrilateral (which is a square with perspective distortion), I can use this method and it works perfectly : Finding the Transform matrix from 4 projected points (with Javascript)



Now if I have an image of a road and I select the edges of the quadrilateral on it to determine a perspective plane.
How can I calculate the perspective projection of squares I draw onto the other sides of the image? The oculus point is not known.
https://i.imgur.com/QhK5mNi.png



For the plane's equation I should be able to use any 3 edge points of the quadrilateral, where: based on the other post's step 6, I compute (x,y,z) of these points.



From there on I am very confused how to and what to do, mostly because I can't imagine how things would look.



Maybe it has to do something with rotation of the plane, which if not related would still be nice to know, because I draw the initial square based on a vector and rotate the texture accordingly, with a downwards looking vector it will look like this and I want to correct it (ignore the diagonals, also the arrow is not perfectly centered) https://i.imgur.com/IMftDpW.png







projective-geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 23 at 21:37







Krend

















asked Jan 23 at 12:24









KrendKrend

11




11












  • $begingroup$
    What do you mean by “the other sides of the image?”
    $endgroup$
    – amd
    Jan 23 at 20:48










  • $begingroup$
    Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
    $endgroup$
    – Krend
    Jan 23 at 21:36












  • $begingroup$
    Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
    $endgroup$
    – amd
    Jan 23 at 23:17










  • $begingroup$
    Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
    $endgroup$
    – Krend
    Jan 24 at 8:23










  • $begingroup$
    Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
    $endgroup$
    – Krend
    Jan 24 at 9:14


















  • $begingroup$
    What do you mean by “the other sides of the image?”
    $endgroup$
    – amd
    Jan 23 at 20:48










  • $begingroup$
    Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
    $endgroup$
    – Krend
    Jan 23 at 21:36












  • $begingroup$
    Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
    $endgroup$
    – amd
    Jan 23 at 23:17










  • $begingroup$
    Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
    $endgroup$
    – Krend
    Jan 24 at 8:23










  • $begingroup$
    Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
    $endgroup$
    – Krend
    Jan 24 at 9:14
















$begingroup$
What do you mean by “the other sides of the image?”
$endgroup$
– amd
Jan 23 at 20:48




$begingroup$
What do you mean by “the other sides of the image?”
$endgroup$
– amd
Jan 23 at 20:48












$begingroup$
Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
$endgroup$
– Krend
Jan 23 at 21:36






$begingroup$
Sorry, I forgot to upgrade the post and clear it up as I was on it. i.imgur.com/QhK5mNi.png This should describe it better, will add it to the post as well
$endgroup$
– Krend
Jan 23 at 21:36














$begingroup$
Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
$endgroup$
– amd
Jan 23 at 23:17




$begingroup$
Be very careful not to confuse homogeneous coordinates of points in a plane with world coordinates of points in the 3-D scene. They’re both triples of numbers, but they mean rather different things. In particular, the coordinates used in the construction of the homography are the former—they don’t really tell you anything about the 3-D world coordinates of points on the road.
$endgroup$
– amd
Jan 23 at 23:17












$begingroup$
Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
$endgroup$
– Krend
Jan 24 at 8:23




$begingroup$
Thank you very much, now it makes sense why it didn't make sense in my head :) Found a gimmicky solution there :stackoverflow.com/questions/76134/… Unfortunately it is too slow for my use case, so I have to scrap it altogether.
$endgroup$
– Krend
Jan 24 at 8:23












$begingroup$
Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
$endgroup$
– Krend
Jan 24 at 9:14




$begingroup$
Well gimmicky I say, but it actually is really good, might be able to just use a less accurate approximation from them
$endgroup$
– Krend
Jan 24 at 9:14










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
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',
autoActivateHeartbeat: false,
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
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3084405%2fperspective-projection-plane-calculating-squares-on-the-plane%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3084405%2fperspective-projection-plane-calculating-squares-on-the-plane%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mario Kart Wii

What does “Dominus providebit” mean?

Antonio Litta Visconti Arese