# calculating distances on a rectangle projected at given angle on a plane

I am trying to work out how to calculate a distance between two points in an image, with the image being projected at a known angle in reference to the plane, ie. the image is projected as a trapezium on to the plane.

If the camera is parallel to the plane it's simple enough to calculate a scale factor of each pixel on the plane according to its distance from the source and the camera parameters, but how do I account for an arbitrary tilt around any axis of the camera?

I have come across homographic transformations in my research, but I'm not sure if that is suitable as I do not have any reference points in the image to match to. The known factors are the angle of the camera as x,y,z values, the perpendicular distance from the sensor to the plane, the dimensions of the camera sensor/pixel size, the focal length (infinite focus), and the position of any given point on the image as pixel coordinates.

• Focal length doesn't seem to be useful information, unless you want to measure the distance between the circles of confusion instead of the projections of points through the center of the lens--and then you would need to know aperture too. Distance from the plane isn't enough; given two points P and Q on the plane, as you move the tilted camera in directions parallel to the plane, the images of P and Q can get closer or farther apart. – David K Jun 16 '17 at 13:15
• To clarify I know the shortest distance from the camera to the plane, ie. the perpendicular (question edited for clarity). I mention focal length as for a camera with no tilt I have used (distance to pixel) / (focal length) * (sensor pixel size) = (projected pixel size). This distance varies with angle but focal length does not. – Koozer Jun 16 '17 at 13:39
• I was thinking of "focal length" in the actual photographic sense, where focal length is a property of the lens itself and is very often not the distance from the lens to the sensor. (It is equal only if the camera is focused at a point infinitely far away.) – David K Jun 16 '17 at 13:45
• In this case images are taken at infinite focus! I also neglected to mention I can know the location of any given point on the image (pixel coordinates). – Koozer Jun 16 '17 at 13:49
• To clarify why the information given is insufficient: suppose you are taking aerial photographs from an airplane flying at constant altitude due north with the camera pointing just a few degrees downward from the direction of travel. Now every photo you take is from a camera at the same distance from the ground and at the same angle to the ground. But if you see two towers far ahead of you, as you continue to fly north the images of the towers will get further apart on the sensor. So angle, altitude, and pixel coordinates are insufficient to work out the distance between the towers. – David K Jun 16 '17 at 13:50