Skip to content
tezvyn:
Menu

Triangulating 3D points from two views

Source: interviewMediumHow cards are made

Summary

3D reconstruction geometry.

Key points

back-project each 2D point into a ray, intersect rays from both cameras using known poses, solve via DLT and refine by minimizing reprojection error.

Watch out for

ignoring noise so rays never exactly meet.

What's really being asked

The interviewer checks understanding of how 2D-to-3D reconstruction works given calibration and pose, and crucially how to handle measurement noise.

The full answer

Geometry: a single 2D point in one image only constrains the 3D point to lie along a ray from that camera's center through the pixel. With two cameras whose projection matrices are known, the same 3D point lies on a ray from each camera, and the two rays should intersect at the point. Method: form equations from the projection relation x equals P times X for each view, stack them, and solve the homogeneous linear system using the Direct Linear Transform, typically via SVD, to get an initial 3D estimate. Refinement: because pixel measurements are noisy, the two rays generally do not meet exactly, so you refine the point by minimizing the reprojection error, the distance between the projected estimate and the observed points in both images, often as part of bundle adjustment.

The mistakes people make

Claiming the two rays always intersect exactly, ignoring noise and the need for least squares. Or saying one view alone suffices for depth. Or forgetting that triangulation requires baseline; pure rotation gives no parallax and fails.

What usually comes next

Why does pure rotation make triangulation degenerate. Why minimize reprojection error rather than the midpoint of the rays. How does baseline length affect depth accuracy. How does triangulation fit into structure from motion and bundle adjustment.

A concrete example

Two cameras a known distance apart both see a corner of a table. Each observed pixel defines a ray from its camera center, and the DLT stacks the projection equations and solves via SVD for the rays' best intersection, giving an initial estimate of the corner's 3D coordinates. Because the detected pixels carry noise the rays do not meet exactly, so reprojection-error minimization nudges the point until its reprojections best match the two observed pixels. Note the baseline matters: a wider separation between the cameras gives more parallax and a more accurate depth estimate, while pure rotation with zero baseline would make the triangulation degenerate.

Interview question

Why is a least-squares or reprojection-error step usually needed during triangulation?

  • a.Because measurement noise means the two back-projected rays rarely intersect exactlyCorrect
  • b.Because triangulation works only with parallel cameras
  • c.Because the projection matrices are always unknown
  • d.Because one camera view is enough to fix depth exactly
Why?

Pixel noise prevents the rays from meeting precisely, so an optimal estimate minimizes reprojection error. One view cannot fix depth, poses are assumed known here, and cameras need not be parallel.

Just read this? Test yourself on what you have been reading.

Read the original → 3dflow.net

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles