# Calculation of the heigth of the camera

I am trying to find the height of a drone using the camera only. I can calculate the distance of the object top and bottom. Object is a square platform with width=0.2m. I used the equation provided by this article: https://www.pyimagesearch.com/2015/01/19/find-distance-camera-objectmarker-using-python-opencv/

Now, i am writing a program for a small drone, is there a way to calculate the height of it using the distances shown in the image below? The platform is always sitting straight as shown in the image. FOV of the camera = 82.6 degrees • I’m voting to close this question because it is about using a camera as a measuring device rather than to produce an artistic or documentary photograph as the end result. – Michael C Jun 23 at 16:01
• Perhaps try at math.stackexchange.com? – Kahovius Jun 23 at 17:19

Assuming your distances are accurate, you have two right triangles:

1. Drone, point on ground below drone (H), bottom corner of platform
2. Drone, point 20cm above ground below drone(H-h), top corner of platform

Using Pythagoras theorem, with D the distance between ground track of drone and platform:

1. `H²+D²=distance2²`
2. `(H-h)²+D²=distance1²`

You substract both sides: `2*H*h-h²=distance2²-distance1²`

I'll let you extract H from that because it is to complicated to write in markdown :)

But I would be surprised if your distance were accurate enough