Skip to content

Pointmaps and matching: DUSt3R and MASt3R

3D from two ordinary photos without camera calibration: DUSt3R predicts a 3D point for every pixel of both images in one frame, and MASt3R adds descriptors and mutual matching for precise correspondences.

Advanced ~13 min8 steps

What runs in CodeSplash

You will be able to

  • Describe a pointmap and what can be recovered from two of them
  • Explain why DUSt3R normalizes pointmaps before comparing them
  • Read a confidence-weighted regression loss
  • Apply mutual nearest-neighbor matching and say what it filters out

Read first

01

Skip the calibration

Read

Classic 3D reconstruction is a pipeline: detect keypoints, match them, estimate each camera's focal length and pose, triangulate, refine. Every stage can fail, and an early failure (too few matches on a white wall) sinks everything after it.

DUSt3R replaces the pipeline with one network. Give it two photos, no camera information, and it returns 3D geometry directly. Poses, depth and focal length are then read off the result instead of being estimated first.

02

DUSt3R: a 3D point per pixel

Read
Reference · VIS021 · Explained hereDUSt3RDUSt3R predicts dense 3D pointmaps from image pairs, supporting reconstruction without requiring known camera calibration as an input to the pairwise model.

For each of the two images DUSt3R predicts a pointmapPointmapAn image-sized grid holding a 3D point for each pixel, in one camera's frame; DUSt3R predicts one for each of two photos.: an image-sized grid holding a 3D point for every pixel, both expressed in the first camera's coordinates, plus a confidence per pixel. A shared ViT encoder reads both images; two decoders exchange information by cross-attention, so each image's geometry is predicted knowing the other's.

Overall scale can't be known from photos alone, so training normalizes each pointmap by its average distance before comparing. In the program the prediction is twice the target plus noise; after normalizing, the per-point residuals are only 0.020, 0.020 and 0.019.

03

Confidence in the loss

Read

Each pixel's error is multiplied by its confidence C, and a term −α log C is added. Raising C on a well-predicted pixel lowers the loss; raising it on a bad one raises it. So the network learns to be confident on textured, well-seen surfaces and unsure on sky, glass and moving objects.

With confidences of 2, 3 and one and a half on small residuals, the program's loss is −0.031: negative, because the log term rewards confidence where errors are tiny. The confidence map is also a useful mask for what to trust.

04

Which matches to keep?

Predict

Predict first

Two photos of a building show rows of identical windows. Which matching rule avoids most wrong correspondences?

Keep every point's best matchKeep a match only if both points pick each otherKeep the three best matches per image
Reveal

Keep a match only if both points pick each other. In repeated patterns, a point's best match in the other image is often a look-alike window; the reverse search then usually points elsewhere, and the one-sided match is dropped.

05

MASt3R: geometry plus descriptors

Read
Reference · VIS022 · Explained hereMASt3RMASt3R augments geometry-based image-pair modeling with dense local descriptors for accurate image matching. It uses a 3D prediction framework to improve correspondences, making it distinct from DUSt3R’s geometry…

Pointmaps are coarse for matching single pixels. MASt3R adds a head that outputs a descriptor vector for every pixel, trained so that pixels showing the same 3D point are more similar than any other pair, a contrastive loss like InfoNCEInfoNCE lossA loss that asks each row to pick out its own corrupted view among the views of every row in the batch. applied in both directions.

Matches are kept by mutual nearest neighborsMutual nearest-neighbor matchingKeeping a match between two images only when each point is the other's most similar point.. In the program, three points in each image all match their counterparts both ways: pairs (0, 0), (1, 1) and (2, 2), with a matching loss of 0.013.

06

What runs here

Read

Scale stays unknown in both: report reconstructions up to scale unless a known distance fixes it, as with relative depth.

07

Check: pointmaps and matching

Checkpoint

Check yourself

What is a DUSt3R pointmap?

Show the answer

Answer: a

Because both pointmaps share one frame, relative pose and depth can be read off them.

Check yourself

Why does DUSt3R normalize each pointmap by its average distance before computing the loss?

Show the answer

Answer: a

The same images fit a small scene nearby or a large one far away. Normalizing removes that unanswerable part.

Check yourself

In DUSt3R's loss C·error − α·log C, where should the network learn to put low confidence?

Show the answer

Answer: a

High confidence multiplies the error, so it only pays where errors are small; the log term stops confidence from collapsing to zero everywhere.

Check yourself

Point a in image A is most similar to point b in image B, but b's most similar point in A is c. Under mutual matching, what happens?

Show the answer

Answer: b

A match survives only if each point is the other's best. One-sided matches are dropped.

Check yourself

What does MASt3R add to DUSt3R?

Show the answer

Answer: a

DUSt3R's geometry is kept; the descriptors make pixel-level correspondences sharper.

08

Recap

Recap
  • DUSt3R predicts a pointmap for each of two photos in one shared frame, with no camera calibration.
  • Pointmaps are normalized before scoring because scale can't be known; confidence weights the loss.
  • MASt3R adds contrastively trained descriptors and keeps only mutual nearest-neighbor matches.
  • Reconstructions are up to scale; both models' weights are non-commercial, so they are explained here only.

Concepts in this lesson