Continue to Site

# How to estimate the actual distance of the object in image?

Status
Not open for further replies.

#### alibarghi

##### Member level 1

The camera is 3 meters away from the playground. How do I get the actual distance between the balls?

#### betwixt

##### Super Moderator
Staff member
The camera appears to be directly over the center line and presumably you know the horizontal and vertical scale (or use distace between the other lines) so think of a triangle 3m high and with a base of the horizontal distance then use trig functions to work out the angle between them and hence their spacing.

Brian.

#### c_mitra

The camera is 3 meters away from the playground.

Distance is defined between two points. 3 meter distance between which points?

First, you need to correct for the distortion. The camera lens is too close and is showing the wide angle effect. (side lines are looking curved whereas they are straight lines).

Simplest way is to use the middle black line as a scale. You can also measure the frame size from the focal length of the lens and the distance of the lens from the centre of the field (of the frame).

They will give you some idea. If the camera is not exactly vertically above (looking down straight), more information is needed.

#### FvM

##### Super Moderator
Staff member
A general solution that doesn't depend on a specific camera position and lens properties would be a calibration grid placed on the playground. Then determine a mapping function (e.g. 2-D look-up table) that calculates x-y coordinates for pixel positions.

Status
Not open for further replies.