Problem, Set, Match
I’m working on a little project that has to do with architecture, but I’m stuck. (Because I’m stupid at math and never took that darn linear algebra course in college.)
So I’m appealling to all my readers who, in fact, are smart. Here’s a math problem for you.
Let’s say I have a ruler and a camera. (which I do) I can take a picture like this:
Fig 1 A
I’ve marked each inch with a little “x”. If we were to look just at the x’s the picture would look like this:
Fig 1 B
Although the ponts are rotated slightly, since the ruler parallel to the base of the camera’s view frustum (ignoring lens distortion), the points are equidistant. If I wanted to figure out what kind of line this was just from these dots, I could easily fit the points to a curve (in this case a straight line) and rotate them straight. To make it look like this:
But what about this case? Where the ruler is in perspective…
Fig 3 A
The dots would look like this:
Fig 3 B
Here the dots are not equidistant. However, I know that this is a straight line and since the distances shrink proportionately each time, I can again redisplay this curve on a plane (again, a straight line) like this (Fig 2):
Now comes the hard part! What if I’ve got a ruler that looks like this?:
Fig 4 A
Dots like this:
Fig 4 B
Can I flatten those to this?:
So the question is: Given a set of points like Fig 4B. Assuming points are equidistant, and the curve lies in a single plane (i.e. isn’t three dimensional) can you transform each of the points into a “flat” plane, where the distance between the points is actually the same?
1.) Since the ruler’s curved, the points are no longer exactly equidistant, but we should assume that they are. (I think, in fact, that the problem is unsolvable if we don’t.)
2.) Without more than one view or camera information, the curve could be reflected. So there are actually two solutions for every input set of points.
3.) This isn’t a 3d to 2d transformation per se, really just a 2d to 2d transformation.