Invisible light. One visible rep.

Explore the dots and triangles behind iPhone push-up counting.

Place your iPhone on the floor, screen facing up. Lower yourself toward it, then extend your arms again.

One rep appears. You never touched the screen.

UdeTancho follows your face as it moves closer and farther away. It uses Apple’s ARKit face tracking. On many iPhones, the depth information behind that experience comes from TrueDepth, the technology also used by Face ID.

But a camera captures a flat image. How does it know not just that a face is there, but how far away it is?

An iPhone projects infrared dots onto a face and a camera at a separate position reads the pattern
Invisible landmarks on a face. Colors, dot count, and component placement are illustrative.

A small face and a distant face can look alike

A face fills more of an image as it approaches the camera and less as it moves away. That provides a clue about distance.

Yet image size alone cannot tell whether a face looks small because it is far away or because it is physically smaller. Absolute distance needs another reference, such as the object’s real size.

TrueDepth supplies its own reference: a pattern it projects onto the face. Apple describes thousands of invisible infrared dots being projected and analyzed to create a depth map. Apple’s Face ID explanation

Using a known projected pattern to recover depth is called structured light. TrueDepth combines a structured-light projector with an infrared camera. To see how that gives a distance, start with just one dot. Apple’s camera documentation

Two directions locate one point

A camera can work out the direction of a dot from where it appears in the image. Place that camera a little to the side of the projector, and two pieces of information come together.

  1. The projector knows which direction it sent the dot.
  2. The camera determines which direction that same dot is seen in.
  3. The two lines meet where the light hit the face.
One outgoing ray leaves the point's distance unknown; adding the camera's viewing ray locates the point at their intersection
Combine two statements of “somewhere on this line” to get “here.”

The spacing between the projector and camera is known, so this triangle also gives a physical distance. That is triangulation. TI’s introduction to structured light

Do this for many points, and the nose and cheeks emerge as a depth map. TrueDepth supplies its own infrared light, so it also works in darkness. Apple’s Face ID explanation

Explore further: pixels, angles, and an interactive experiment

The object, the lens, and the sensor

Consider three things: a point on the observed object, the camera lens, and the flat image sensor behind it. The sensor contains a two-dimensional array of pixels. In the side view below, it appears as a vertical line.

Light from the measurement point P passes through the lens and forms an image at pixel p. The drawing follows one representative ray through the optical center of a simplified lens. It shows how a point above the camera’s central axis forms an image below that axis.

Three labeled parts: a point on an object, a lens, and a flat image sensor. A ray from the point passes through the lens center to an off-center pixel.
A side view. The sensor is a flat surface, not another light source. The line represents light traveling from the object into the camera.

Now read the diagram backward: the camera knows which pixel received the light. Connect that pixel to the lens’s optical center and extend the line toward the object. That line gives the viewing direction. Its angle to the camera’s central axis is θ.

The sensor alone provides a pixel position. The known lens geometry turns that position into an angle: a larger offset corresponds to a more oblique direction. A real camera uses calibrated lens parameters to make this conversion.

The angle follows a simple ratio: pixel offset from the image center ÷ effective focal length. More precisely, the reference is the calibrated principal point, which need not be exactly at the image center. Both quantities must use the same units. For example, an effective focal length of 1,000 pixels and an offset of 100 pixels give tan θ = 100 / 1,000 = 0.1, so θ ≈ 5.71°. These are example values, not iPhone specifications.

The drawing uses a simplified lens model. Calibrated camera intrinsics and lens correction provide the correspondence between a pixel and a viewing direction. ARKit exposes focal length and principal point in pixel units through its camera intrinsics. Apple: camera intrinsics

From angle to distance

For example, draw the projector and camera 2 cm apart on paper. Draw a ray straight ahead from the projector and another ray angled inward by about 5.71° from the camera. They meet 20 cm ahead of the device. The known 2 cm spacing supplies the physical scale. You do not need to know the face’s size. These are illustrative dimensions, not iPhone specifications.

The base is 2 cm and the height is 20 cm: a long, narrow triangle. The dashed line is the camera’s straight-ahead direction.
The base is 2 cm and the height is 20 cm: a long, narrow triangle. The dashed line is the camera’s straight-ahead direction.

For a simple setup with parallel camera and projector axes and a dot projected straight ahead:

Depth = projector–camera spacing ÷ tan(viewing angle)

Move the slider to see the relationship. Its dimensions are illustrative, not iPhone specifications.

OPTICS LAB / 01Move the surface. Watch the angle.
Device / top view Surface · 30 cm ProjectorCamera Fixed ray Viewing angle changes

Viewing angle 3.81°

Try the slider: closer means a larger angle. A simplified model with a fictional 2 cm sensor spacing; the drawing exaggerates this spacing. These are not iPhone specifications or live measurements.

These diagrams explain general structured-light geometry. Matching captured dots to the projected pattern and correcting measurements are also necessary; this is not a reproduction of every TrueDepth implementation detail. TI’s structured-light processing guide

Turning distance into a push-up

UdeTancho does not reconstruct your face from scratch. ARKit supplies a tracked 3D face position, and the app calculates distance from that position. Apple’s ARFaceAnchor documentation

The app uses recent movement to establish a reference for the farther, arms-extended position. Moving closer by a set proportion marks the lowering phase. Returning toward the reference distance completes the rep.

A distance trace moves from far to near and back to far, adding one rep on the return
Separate lowering and return thresholds identify a complete cycle.

An approach is only half the movement. The return completes it. Distance information and the app’s movement logic work together. A minimum interval between counts also helps prevent rapid repeat counts from small movements.

The app follows changes relative to your movement reference rather than relying only on one fixed distance from the floor. Tracking can still be affected if your face leaves view or the phone moves. Following face movement does not validate full-body push-up form.

Which iPhones have TrueDepth?

TrueDepth arrived with iPhone X in 2017 and is used in Face ID-capable iPhones. The iPhone SE generations do not have it; iPhone 16e and 17e do support Face ID. Apple’s supported-model list

ARKit can also return 3D face positions on supported devices without TrueDepth, but captured depth data is available only with a TrueDepth camera. UdeTancho can use face-position estimates on supported SE models; that does not imply identical measurement conditions or accuracy. Apple’s ARKit 4 presentation

Familiar technology, a different everyday use

The hardware you usually associate with unlocking your phone can also help follow a push-up. Beneath that ordinary action are invisible dots and small triangles.

In UdeTancho, those reps gradually reveal the characters of Japanese poems. Discover what comes after the count in Collect Japanese Landscapes, One Poem at a Time, or visit the FAQ for setup and use.

Next time you lower yourself toward your iPhone, picture the invisible landmarks on your face.

UdeTancho

Collect a scene, one push-up at a time

Explore the push-up counter and its collection of illustrated Japanese poems.