Learn

Find a point with the camera.

A camera pixel gives a direction, but not a distance. In this scene, the known floor height tells us where that direction meets the ground. Raise the camera until the amber ray reaches the blue marker.

Camera workspace

Raise the camera until the orange ray reaches the blue target.

Ray at 0.50 m · Target at 1.00 m

Explore the pixel

x = 2 × (470 − 320) / 600 = 0.50 m

Camera 2.0 m above the floor, pixel 470, floor position 0.50 m. Blue target at 1 m. Click the highlighted floor strip to change the ray. The translucent plane is a virtual image plane.

2D reference and fallback
Side view of a camera ray meeting a flat floorThe camera is 2 meters above the floor. Pixel 470 projects to 0.50 meters horizontally from the point directly below the camera.Target 1 mFloorh = 2 mCamerax = 0x = 0.50 m
Why the target moves

At pixel 470, doubling the camera height from 2 m to 4 m moves the floor hit from 0.50 m to 1.00 m. The ray angle stays the same. A cup on a table meets the ray before it reaches the floor.

Why the floor point moves

The amber line is the direction seen by one pixel. The camera points down, but this pixel is to the right of the image center, so its ray tilts sideways. The dashed line marks the point directly below the camera. The gap between that point and the amber floor marker is the distance we want to find.

The selected pixel stays fixed as you raise the camera, so the ray keeps the same angle. A longer drop leaves more distance to travel sideways. Doubling the height doubles the sideways distance; it does not change which pixel you selected.

Here, pixel 470 is 150 pixels right of the image center. With a focal length of 600 pixels, the ray travels 150 / 600 = 0.25 meters sideways per meter downward. At a height of 2 meters, the floor point is 0.50 meters to the right. Raising the camera to 4 meters moves it to 1.00 meter.

Checkpoint

Same pixel, same lens: 150 pixels right of center, focal length 600 pixels. The camera now hangs 3 meters above the floor. How far to the right is the floor point?

Commit to an answer. Every choice explains itself.

This assumes a camera pointing straight down at a flat floor. A table or shelf can intercept the ray earlier. Finding a position does not establish a clear route for a robot.

Try the calculation in Python

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.