1
$\begingroup$

I'm not sure this is the right place to ask this question. If not please point me in the right direction.

Question: is there a way to calculate the size of, say a back yard, or the walls in a room from a picture?

Update: Let's say someone has an android or iphone where the specs of the camera were known. If I just went into my back yard and took a few pictures could I estimate the size of my backyard or any backyard just from the picture. Maybe I could draw on the image lines that delineate the boundaries of the property.

  • 0
    lampShade -- that's like calling your kid "helmet" ;-)2012-04-06

2 Answers 2

2

For the back yard...

Go place three soccer balls or rubik's cubes or some objects in your yard, preferably so that two of them are equidistant along perpendicular lines from the the third and all are at the same height, if possible. Then take the picture with the full perimeter and the markers all in the field of view. It will greatly simplify the analysis, because you then have a two dimensional coordinate system. Next, we need to annotate the coordinate axes, and a closed curve representing the base of a wall bounding the yard at the same uniform height as the coordinate system you introduced. Then, we calculate the coordinates of this boundary using a projective transformation (which also needs to be modeled/annotated/calculated). Lastly, we can calculate the area from the 2D coordinates.

At this point, assuming you have done the annotations as two red line segments for the coordinate vectors and a blue curve for the perimeter (projected onto the coordinate plane), your best bet might perhaps be utilizing the Python interface to OpenCV to calculate a 2D parametrization of the perimeter, even on Android.

  • 0
    Some related links: [Areal photography](http://en.wikipedia.org/wiki/Aerial_photography), [surveying](http://en.wikipedia.org/wiki/Category:Surveying), [coordinate systems](http://en.wikipedia.org/wiki/Category:Coordinate_systems), [3D projection](http://en.wikipedia.org/wiki/3D_projection), [perspective](http://en.wikipedia.org/wiki/Perspective_(graphical)), [projective geometry](http://en.wikipedia.org/wiki/Category:Projective_geometry), [object recognition](http://en.wikipedia.org/wiki/Object_recognition), [ground plane estimation](http://stephense.com/research/papers/ras02.pdf)2012-04-06
1

You can do it in various ways depending upon the data you have. If there is something of known size in the image, you can use it for scale. If you know the focal length of the lens you can use geometry. In most cases you need to consider that the distance from the subject to the camera varies over the scene. Without better definition it is hard to give more of an answer.

In response to the update: the easiest is if you lie the phone on the ground and take a picture looking straight down so the yard is parallel to the image plane, though it would be better to have the objects closer in size. You can just scale by number of pixels-if the yard is 100 times as many pixels as the phone, it is 100 times as large. This works if the angles are small. If not, you are in for a bit of trigonometry and can draw the diagram to find the angles of interest.

If the items are not parallel to the image plane, there is perspective going on. It can still be resolved, at least sometimes, and again a diagram and trigonometry are your friends.

  • 0
    Where can I read more on this topic? I don't quite understand the solution you posed2012-04-06