0

Please refer to the following image:

enter image description here

I have the real height of the building which is $12.5 \text{ m}$ (red line).

I have the blue lines in the image (pixels) as well as the red line.

I have the vanishing point - the intersection of the blue lines.

Is it possible to calculate the real length of the blue line either in the world or in the image? Or what else do I need for calculating that?

Elia besh
  • 21
  • 1
  • 2
  • You need at least a reference measure on that direction, and the angle that it makes wrt the projection plane, so that you can reverse the process here ( http://www.automotiveillustrations.com/tutorials/drawing-2-point-perspective.html ) described to create the top view from the perspective. – N74 Jan 10 '17 at 21:21

1 Answers1

0

Is it possible to calculate the real length of the blue line either in the world or in the image?

I'd say no.

Or what else do I need for calculating that?

I'll try to give you some insight about what is needed to make this work. The posts I link to may provide further details to show how certain things can be done in a projected image.

As a general rule, if you know the relative real-world positions between any four non-collinear points in a single plane then you can compute the transformation matrix and apply its inverse to un-project that plane and read any other dimensions from that.

The same goes for three distinct points on a line, which allows you to perform projective correction along that line. You should have three points on the red vertical line, namely the two endpoints of the segment and the point where all the vertical lines in the image intersect. If the lines are parallel in the image, too, that intersection would be at infinity, which is fine for projective geometry. So you can compute lengths along the line, e.g. using the cross ratio.

You have one further point in the plane spanned by the red and blue lines, namely the point at infinity where the blue lines intersect. But these four points in total are not enough, since the three points on the vertical line are collinear. You will need at least one more real world measurement on that wall which is not merely along a vertical line.

Depending on what kind of measurement you get, incorporating that with the rest may be more or less difficult. So for example knowing the distance of a window corner to the vertical edge will be slightly easier than knowing the width of a window, and knowing some angle would be different again. But chances are that if you have one more bit of information then you can read all you need off that.

One possible way to obtain more information might be by using the ground plane. You already have three points in the ground plane, namely two at infinity along the directions of the two prominent walls, and one where the walls meet. But to establish measurements there, you need one more point which does not lie on the bottom of a wall.

If the ground were planar, you might be able to use the round sewer hole in the front for reference. A perfect circle intersects the line at infinity in a pair of ideal circle points with complex coordinates. Intersecting the ellipse that is the picture of the sewer hole with the line at infinity would result in a pair of complex conjugate points, too, and mapping these to the circle points would correct all angles in the ground plane. Similar to what I did here. But we still wouldn't have a way to get the scale right, as you don't have any scale information in the ground floor. All the points I mentioned are at infinity and don't provide that. And anyway it looks as though the sewer hole were located on a sloped path.

Another possibile source of information might be the EXIF information of the photograph, particularly if it does contain details about the distance between the camera and the object in focus. But as most of the wall appears to be in focus fairly well, that information might be very far off without us noticing.

MvG
  • 42,596