4
$\begingroup$

Unsure if this is the right network to post this, but maybe someone can help...

I'm working on a personal project where, with the help of AI, I want to automatically estimate the perspective of a given image.

I've been able to programatically estimate and draw the position of the horizon, as seen below. This is based on how "quickly" cars farther away shrink in the image.

enter image description here

Not sure the above is useful, but now I want to draw a grid on the plane. Something like:

enter image description here

This is where it's getting too complicated for me. I have no idea how to solve this. Not the drawing per se, but the mathematics behind it. Any ideas?

$\endgroup$
2
  • $\begingroup$ If you know the delta (shrinkage) between cars (it won't be that accurate as cars may have different sizes) maybe you can use that information to feed somehow a perspective matrix transform. I'd start by plotting the centroids of the rectangles in a 3d grid and manually tuning the input parameters for a perspective projection matrix, I think you could get fancier and use simulated annealing or something similar to do so too. $\endgroup$ Commented Dec 6, 2020 at 22:40
  • $\begingroup$ Note: your horizon estimate is a bit high. $\endgroup$
    – joojaa
    Commented Dec 21, 2020 at 16:06

0

Browse other questions tagged or ask your own question.