Module 9/10 · Weeks 13–14 · 14 h

Structure from motion and 3D point clouds

UAT 451 UAS Technology for Surveying, Mapping and Photogrammetry

About 85 minDraft, awaiting reviewLast updated 21 October 2026

Lesson

By the end of this module you will be able to

  1. Explain the structure-from-motion (SfM) steps from feature detection to bundle adjustment
  2. Compute the number of RANSAC iterations needed for a given inlier ratio
  3. Estimate how many images see a ground point from the overlap, and design flights for 3D models
  4. Explain dense matching (MVS) and check the quality of 3D point clouds
  5. Estimate the triangle count of a mesh and the texture size of a 3D model

Prerequisites: Module 8 Camera calibration and geometric correction

Why this matters

When you press the processing button, the software must work out which images see the same point, where each image was taken from, and where every point lies in 3D, from hundreds of images that nobody has linked together. Understanding these steps explains why some image sets fail to process, why reflective roofs or water become holes, and how to fly to get complete building walls.

The structure-from-motion steps

Six boxes in two rows. Top row: detect features, to match images, to reject with RANSAC. An arrow goes down to the bottom row: add images (incremental SfM), to bundle adjustment, to dense matching (MVS) producing a 3D point cloud
Figure 1 Structure-from-motion steps
  1. Feature detection: find distinctive points, such as the corners of road markings, with a descriptor that stays the same when the image rotates or changes scale
  2. Image matching: compare descriptors to find likely matches. Drone work uses the GNSS positions in the images to match only nearby images, saving a lot of time
  3. Rejecting wrong matches with RANSAC: some matches are always wrong, for example on repeated tile patterns, and must be removed by checking whether they fit the two-image geometry
  4. Incremental SfM: start from a good image pair and add images one at a time, computing new 3D points, the approach of programs such as COLMAP described by Schönberger and Frahm (2016)
  5. Bundle adjustment: adjust camera positions, lens values and all points together to minimise total reprojection error, repeated at intervals as images are added
  6. Dense matching (multi-view stereo, MVS): once the cameras are known, depth can be computed for nearly every pixel, so the point cloud is hundreds of times denser than the tie points

RANSAC rejects wrong matches

RANSAC (random sample consensus) by Fischler and Bolles (1981) randomly draws the smallest set of matches that can define a model, then counts how many other matches agree. It repeats many times and keeps the model with the most support, like finding the truth in a room with some liars: ask enough small random groups and one of them will contain only honest people.

The number of iterations needed to have probability of drawing at least one all-correct sample is

where is the inlier ratio and the sample size. A camera with known interior values needs 5 matches (essential matrix); one without needs 8 (the eight-point fundamental matrix).

Example 1 More wrong matches, how many more iterations?

import math

P = 0.99                                  # required probability of drawing at least one clean sample
for s, model in ((5, "essential matrix"), (8, "fundamental matrix")):
    for w in (0.9, 0.7, 0.5):             # inlier ratio of matches
        n = math.log(1 - P) / math.log(1 - w ** s)
        print(f"{model:<18} s={s} inliers {w:.0%}: {math.ceil(n):>5} iterations")
essential matrix   s=5 inliers 90%:     6 iterations
essential matrix   s=5 inliers 70%:    26 iterations
essential matrix   s=5 inliers 50%:   146 iterations
fundamental matrix s=8 inliers 90%:     9 iterations
fundamental matrix s=8 inliers 70%:    78 iterations
fundamental matrix s=8 inliers 50%:  1177 iterations

With 90% correct matches only a few iterations are needed, but with only half correct the eight-point method needs almost 1,200 iterations, while the five-point method needs about 150. Blurred images, water, moving trees and repetitive surfaces lower the inlier ratio, so processing becomes slower and more likely to fail.

Designing flights for 3D models

The more images a point appears in, the more stable its computed position and the easier it is to reject wrong matches. The average number of images seeing a point can be estimated from the overlap

Example 2 Overlap and images per point

for front, side in ((0.8, 0.7), (0.75, 0.6), (0.7, 0.6), (0.6, 0.3)):
    n = 1 / ((1 - front) * (1 - side))   # approximate number of images seeing one ground point
    print(f"front {front:.0%} side {side:.0%}: each ground point in about {n:4.1f} images")
front 80% side 70%: each ground point in about 16.7 images
front 75% side 60%: each ground point in about 10.0 images
front 70% side 60%: each ground point in about  8.3 images
front 60% side 30%: each ground point in about  3.6 images

80/70 overlap puts each point in about 17 images, while 60/30 gives fewer than 4, too few in areas with trees or reflective surfaces, because some images will fail to match and the point is left without enough usable views.

Horizontal bar chart of four bars showing images per ground point for front and side overlap: 80/70 about 16.7, 75/60 about 10.0 and 70/60 about 8.3 in blue, and 60/30 about 3.6 in pink
Figure 2 Average number of images seeing a ground point

Building walls: vertical images barely see walls, so a 3D model of the existing 20 m building in the case study needs

  • Orbits around the building with the camera tilted towards it, at several heights
  • Oblique images in four directions from the normal flight lines, so every wall is seen
  • Close-range images where detail is needed, such as cracks, linked to distant images by gradually changing overlap rather than a sudden jump in distance

Checking point cloud quality

  • Density: points per square metre; areas where density drops sharply show that images matched poorly there
  • Holes: usually on water, shaded roofs, glass and plain surfaces without texture, where no features can be found
  • Noise: points floating in the air or buried below the ground, usually from wrong matches that slipped past RANSAC
  • Surface thickness: a smooth surface such as a concrete yard should be a thin layer; a layer several centimetres thick shows noisy depth
  • Comparison with a reference model: tools such as CloudCompare measure cloud-to-cloud distances to find areas of unusual difference

Mesh models and texture

A dense point cloud is not yet a 3D model that opens smoothly. The next step is to build a mesh, a set of connected triangles forming a surface. A common method is Poisson surface reconstruction by Kazhdan et al. (2006), which uses all the points with their surface normals at once, so it tolerates noise and gives a closed surface. A closed surface can, however, invent surface across holes where there is no real data, so check before measuring. In ODM the resolution is set with --mesh-octree-depth (default 11) and the vertex count is capped by --mesh-size (default 200,000). The software then paints colour from the photographs onto each triangle; the method of Waechter et al. (2014) is designed for many images that differ in scale, blur and exposure, and gives a mesh and texture images (odm_textured_model.obj). Large models are streamed over the web as tiles under the OGC 3D Tiles standard.

Example 3 How fine should the mesh of a 20 m building be

Four walls 20 m high and 22 m wide each, plus a 22 x 22 m roof (assumed). If vertices are apart there are about vertices, and about twice as many triangles.

import math

AREA = 4 * 22 * 20 + 22 * 22              # four walls and the roof (m2, plan 22 x 22 m assumed)
for s_cm in (10, 2):
    verts = AREA / (s_cm / 100) ** 2
    print(f"vertex spacing {s_cm:>2} cm: {verts:>10,.0f} vertices, about {2 * verts:>10,.0f} triangles")
print(f"default cap of 200,000 vertices -> spacing about {math.sqrt(AREA / 200_000) * 100:.1f} cm")
px = AREA / 0.002 ** 2                    # texture at 2 mm per pixel
print(f"texture at 2 mm per pixel: {px / 1e6:,.0f} million pixels = {px / 4096 ** 2:.1f} atlases of 4096 x 4096")
vertex spacing 10 cm:    224,400 vertices, about    448,800 triangles
vertex spacing  2 cm:  5,610,000 vertices, about 11,220,000 triangles
default cap of 200,000 vertices -> spacing about 10.6 cm
texture at 2 mm per pixel: 561 million pixels = 33.4 atlases of 4096 x 4096

With ODM’s default cap the vertices are about 10.6 cm apart. Going down to 2 cm would take about 11 million triangles, too heavy to open on the web. A 2 mm crack is therefore in the texture, not in the shape. A texture at 2 mm per pixel has about 561 million pixels, equal to 33 sheets of 4,096 x 4,096, so it is split into tiles and the fine texture is used only where it is needed.

Module lab

Lab: build a 3D model of a building

  1. Plan a flight over the construction site with 80/70 overlap plus an orbit around one building, under your lecturer’s supervision
  2. Process with COLMAP or WebODM, recording the number of images registered, tie points and reprojection error
  3. Reprocess without the orbit images and compare the building walls in the two models
  4. Open the point cloud in CloudCompare, find holes and noise, and record likely causes
  5. Compute RANSAC iterations for the inlier ratio the software reports (if any) with the code in Example 1

Common mistakes

Watch out

  • Cutting overlap to save flight time, so trees and roofs fail to connect
  • Using only vertical images and expecting complete building walls
  • Jumping straight from distant to close images, so the two sets cannot be matched
  • Filling holes with automatic surfacing and delivering it as if it were real data
  • Not checking noise before building a DSM or computing volumes from the point cloud

Summary

  • SfM detects features, matches them, rejects wrong matches with RANSAC, builds the model incrementally and runs bundle adjustment; MVS then densifies the point cloud
  • RANSAC iterations rise very quickly as wrong matches increase
  • Approximate images per point ; high overlap makes the model stable
  • Building walls need oblique images or orbits
  • Check point clouds for density, holes, noise and surface thickness

Check your understanding

  1. Why does drone work use the images’ GNSS positions to help matching?
  2. With 75/60 overlap, in about how many images does a point appear?
  3. With a 70% inlier ratio, the five-point method and , about how many iterations are needed?
  4. Why does water often appear as a hole in the point cloud?
  5. How should you fly to capture building walls in a 3D model?
Answers
  1. To match only nearby images, saving time and reducing wrong matches
  2. images
  3. About 26 iterations ()
  4. Water moves and reflects light, so each image sees it differently and too few matchable features are found
  5. Orbit the building with the camera tilted towards it, or add oblique images from several directions

Key formulas

RANSAC iterations
Approximate images per point
Vertices of a mesh

Key references

  1. Schönberger, J. L., & Frahm, J.-M. (2016). Structure-from-motion revisited. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 4104-4113). https://doi.org/10.1109/CVPR.2016.445 link
  2. Fischler, M. A., & Bolles, R. C. (1981). Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24(6), 381-395. https://doi.org/10.1145/358669.358692 link
  3. Snavely, N., Seitz, S. M., & Szeliski, R. (2006). Photo tourism: Exploring photo collections in 3D. ACM Transactions on Graphics, 25(3), 835–846. link
  4. Westoby, M. J., Brasington, J., Glasser, N. F., Hambrey, M. J., & Reynolds, J. M. (2012). 'Structure-from-Motion' photogrammetry: A low-cost, effective tool for geoscience applications. Geomorphology, 179, 300–314. link
  5. Hartley, R., & Zisserman, A. (2004). Multiple view geometry in computer vision (2nd ed.). Cambridge University Press. link
  6. Mapillary. Incremental reconstruction algorithm. OpenSfM documentation. link
  7. OpenDroneMap Authors. Options and flags. OpenDroneMap documentation (Version 3.6.0). link
  8. OpenDroneMap Authors. Outputs. OpenDroneMap documentation (Version 3.6.0). link
  9. Kazhdan, M., Bolitho, M., & Hoppe, H. (2006). Poisson surface reconstruction. In K. Polthier & A. Sheffer (Eds.), Eurographics Symposium on Geometry Processing (SGP 2006). Eurographics Association. link
  10. Waechter, M., Moehrle, N., & Goesele, M. (2014). Let there be color! Large-scale texturing of 3D reconstructions. In Computer Vision - ECCV 2014 (Lecture Notes in Computer Science, Vol. 8693, pp. 836-850). Springer. https://doi.org/10.1007/978-3-319-10602-1_54 link
  11. Open Geospatial Consortium. OGC 3D Tiles community standard (3D Tiles Specification 1.1, OGC 22-025r4). link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Surveying, mapping and geoinformatics