11

Suppose that I have a single point perspective drawing like this.

and suppose also that I know some of the real horizontal distances and distances along lines converging to vanishing point. E.g if i know the real length and breadth of a slab of pavement. Is it possible to derive other real distances e.g the width of the road and the length of a house?

Narasimham
  • 40,495
Allin
  • 147

1 Answers1

13

You can use the cross ratio for this purpose. If $A,B,C,D$ are collinear and $A$ is the vanishing point of that line, then the cross ratio $(A,B;C,D)$ will give you $\frac{\overline{BD}}{\overline{BC}}$, i.e. a ratio of real world lengths. So let $B,C$ be two corners of a slab, and let $A$ be the intersection of that line with the vanishing line, then you can measure the position of any point $D$ on that line.

Using homogeneous coordinates to handle infinite values, one can verify this property for a non-deformed situation, and one can also show that the cross ratio is invariant under projective transformations, hence it must be correct in that image as well.

If the vanishing point of a given line is at infinity, like for the horizontal lines in your picture, then they are only subject to an affine transformation, so ratios of lengths on these lines are preserved by the perspective projection.

If you want to measure distance between points which are not located on such a slab-edge line, things become a bit more complicated. Right now I'd suggest you think of the slab directions as coordinate directions. So you have one coordinate direction which is towards the vanishing point at the end of the street, and another coordinate direction orthogonal to that which is horizontal and therefore only subject to affine transformations. You may choose one slab corner as the origin of your coordinate system. Then any point in the ground plane may be projected onto your coordinate axes, by drawing one line connecting it to the end of the road and one line horizontal. This gives you two points which represent the $x$ and $y$ coordinates of the point in question, and which you can measure as described above. You can establish coordinates for all points in this fashion, then use the Pythagorean theorem to compute lengths from that.

Annotated drawing

Of course, all of this depends on an exact drawing. Which doesn't seem to be the case in your drawing: although points $B$ and $D$ are only $4$ slabs apart, the cross ratio measures more than $6$. So either the drawing is inaccurate, or the slabs have different sizes. But if you pay attention, you might notice that even to the trained eye the slabs in the distance look longer than those near by.

MvG
  • 42,596
  • A marked O in drg? – Narasimham Apr 02 '15 at 10:38
  • @Narasimham: No, $A$ is $A$, the vanishing point on that line. $O$ is the origin for the coordinate system, with $P$ projected onto the axes as $P_x$ and $P_y$. It might have been more clever to make $O$ equal to $B$, since it already was used as the origin for measurements along one axis, but that's a different story. – MvG Apr 02 '15 at 10:49
  • I just chose an image randomly from Google so I didn't know that the lengths were wrong. I'll work out my example for now and come back to you with my results. – Allin Apr 02 '15 at 12:02
  • I guess we should use the original example to stay relevant. I'm looking at the problem and trying to figure out how you plugged everything into the equation. The long form is (A-C / A-D) / (B-C / B-D), right? Assuming B = 0, I measured the following values: C = 74px, D= 158px, A=205px. After plugging into the equation and solving I got 0.0122. I'm just not sure how to solve for points or distances. – skibulk Apr 19 '16 at 23:58
  • 1
    @skibulk: If you add the neccessary parentheses, namely $((A-C)/(A-D))/((B-C)/(B-D))$ you get $\approx5.95$ from your numbers, wich is within the expected margin of error. Without the parentheses you have $C/B$ as one term which would be a division by zero. So I'm not sure what you computed, but there has to be an error in there somewhere. – MvG Apr 20 '16 at 05:03
  • Right you are. So we know the cross ratio is 5.95. Lets say that BC is a real world distance of 1 meter. how do we find a point that extends 0.5 meters toward us in perspective or a point that extends 0.5 meters away from us? – skibulk Apr 20 '16 at 11:56
  • 1
    @skibulk: Algebraically, you can cross-multiply the cross-ratio equation and end up with a simple linear equation for the point you're after, i.e. its distance from $B=0$. As a more geometric alternative, you could construct $E$ as the harmonic conjugate of $A$ wrt. $B,C$, which is the projection of the midpoint of $BC$, then construct $F$ as the harmonic conjugate of $E$ wrt. $A,B$ resp. $A,C$ to projectively reflect that in $B$ resp. $C$. – MvG Apr 20 '16 at 13:20
  • So after cross multiplying the equation and plugging in A, B, and C, I have this: (205-74)(0-D) = (0-74)(205-D). I need to solve for D in pixels across the picture plane, where D also equals 0.5 meters in perspective. One problem I'm having is that the equation only uses measurements from the picture plane. I don't see how the real-world measurements factor in. – skibulk Apr 20 '16 at 14:02
  • Do I plug the real world numbers into the same equation and then subsiture half of the equation for the other? So AC * BD (picture plane) equals BC * AD (real world)? Since A is infinity in real life, it doesn't seem to work. – skibulk Apr 20 '16 at 14:22
  • 1
    @skibulk: No, all the distances are picture plane. The only real world element is the right hand side of the equation, i.e. the value of the cross ratio. You have $(A-C)(B-D)=\lambda(A-D)(B-C)$, plugin the measured $A,B,C$ and the desired real-world $\lambda$ and solve for $D$ which again will be measured in the picture plane. – MvG Apr 20 '16 at 14:27
  • Sorry I'm such a noob with this. λ wasn't in the equation before! I guess it is implied for people in the know. Is lambada supposed to be a ratio of BC (3 meters) to BD (3.5 meters) or? – skibulk Apr 20 '16 at 15:08
  • 1
    @skibulk: $\lambda$ was in this post you read before, and I just introduced it here to have some symbol represent the value of the cross ratio. And yes, it's the real-world ratio of $BD$ to $BC$. – MvG Apr 20 '16 at 18:00