image-processingcomputer-visionprojective-geometry

Calculate distance between two points in a perpective image


I want to verify the distance between two points C and D (CD) in a perpective image.

The picture is taken in my living room. Dimension of each tiles is 0.6x0.6 (in meters).

enter image description here

Real world measurements:

Distance between point A and point D (AD) = 1.8 meters. Distance between point A and point B (AB) = 0.6 meters

Image plane coordinates:

A' = (232, 613)

B' = (221, 341)

C' = (215, 189)

D' = (210, 98)

enter image description here

I used cross ratios to calculate CD.

R{A', B', C', D'} = 1.316

and

R{A,B,C,D} = (AC * BD)/(AD * BC)

After calculation, CD is 0.584m (Instead of 0.6m)

Questions:

1) Is the method I'm following to verify CD correct?

2) Should I consider the angle between A and D (which is not 90 deg)

3) Should I look into vanishing points here?

4) If we don't know the real world distance between A and B and know only AC and AD, is it possible to calculate the distance between either B and A or B and D?

5) The difference 0.016m in the above calculation, is it acceptable?

I'm newbie to Projective geometry. Please let me know if I'm doing anything wrong.


Solution

    1. The method is correct, though I would use a homography instead.
    2. Angle is irrelevant, crossratio is projectively invariant
    3. Not necessary.
    4. Yes, after estimating the homography between the plane and its image, every distance on the plane can be estimated from the image, provided at least one is known to resolve scale.
    5. "Acceptable" is in the eye of the beholder, since it depends on your application. A 2.67% relative error may be OK for your pasta recipe, but if you are a welder intent on joining beams on a bridge, anything more than a few mm will be too much.

    Suggestion - measure more points, remove nonlinear distortion (the line at the bottom of the wall in the upper portion of your image looks bent), estimate homography.