Methodology • 3D Terrain and Volumes

3D-surface volume computation in RockGeo: foundations, on-device photogrammetry and validation

Technical team: Thard Tech Method version: 2.2 (December 2026) — guided capture in Beta Reviewed: 2026-12-05

Abstract. This text describes how RockGeo computes stockpile, pit, cut and fill volumes from 3D surfaces, how those surfaces are obtained and how the result is shown in 3D. Surfaces come from topographic surveys, from iPhone and iPad LiDAR, or from photogrammetry processed on the phone itself. Volume is integrated exactly by overlaying the top and base triangle meshes, clipped by the computation polygon, and always comes with its own uncertainty for each quantity: fill, cut or net. On solids with an analytical volume, exact integration matches flat-faced cases up to numerical rounding, and curved solids fall within 0.07 % of the exact value. A Monte Carlo simulation confirmed that the published uncertainty covers the actual error at the expected rate: 93.5 to 95 %, for 95 % nominal. The results were cross-checked by an independent integrator. The 3D view orbits, zooms and shows cut, fill and the volume as a solid, at 60 frames per second on an upper-mid-range phone. We also report a negative result and the known limitations. Version 2.1 adds, in Beta, a wizard that removes the need to fill in reference systems, guided photo capture inside the app, offline reconstruction on iPhone as well, and display of the model in the real colours of the photos. In synthetic tests with noise, the estimated capture centre was 9 cm from the true one (median) on a 5 m circle, and the scale obtained from the AR poses was off by 0.04 % (median) and at most 0.20 %. Version 2.2 adds automatic recording: the user walks around the object and the app picks the frames on its own, about 43 per lap. It also adds scale from the phone's motion, measured by ARCore. In 500 simulations with 2 cm of position noise, the scale error had a median of 0.12 % and a maximum of 0.50 %.

Beta. Guided capture, automatic recording, ARCore scale, reconstruction on iPhone and real-colour 3D are new features, validated by automated tests and not yet by a field test with a known volume. The volume engine is the same as in version 2.0. Check results for contractual or official use with another method.

Scope and design principles

The tool answers a field question: what volume of material lies above (or below) a base, inside a polygon? It was designed around three principles:

  • The same computation on every device. The engine is a single code base shared by Android and iOS. The same input file produces the same volume on both platforms, which is checked by automated tests.
  • No volume without an uncertainty. A number without uncertainty leads to wrong decisions. When scale cannot be verified, the result is explicitly flagged as an estimate.
  • Working in the field, offline. Volume computation, LiDAR and photogrammetry run on the device itself.

The tool does not replace RTK GNSS, total station or aerial surveys over large areas. It is suited to small and medium stockpiles, pits and faces, under the conditions in section 8.

Surface representation

The top surface is a triangulated irregular network (TIN). Inside each triangle with vertices Pa,Pb,Pc, the elevation at any point is the linear interpolation by barycentric coordinates:

z(x,y)=waza+wbzb+wczc,wa+wb+wc=1

When the surface comes from points (survey or point cloud), it is triangulated by Delaunay with breaklines and boundaries preserved. When it comes from a file that is already a mesh (LandXML, for example), the original mesh is kept without retriangulation, to respect the delivered survey. Triangles are indexed in a uniform spatial grid, so each query only examines the triangles of the matching cell.

Local coordinates. UTM coordinates reach 7.5 million metres. Products such as xayb then exceed 1012, and double-precision rounding is about 5×10−4 m² per term. On a 10 cm square this alone distorts the area by more than 2 %. Before any computation, the engine therefore moves all geometry to a local origin on the polygon itself, still in double precision. With this change the same square has an area of 0.00999999996 m² (section 7.1).

Point cloud reduction. Large clouds (LAS, PLY, LiDAR, photogrammetry) are reduced by a plan grid. The rule for choosing each cell's point depends on the purpose:

  • Median elevation, the default for photogrammetry: the point in the middle when the cell's points are sorted by elevation. It keeps the surface unbiased and ignores isolated spurious points.
  • Lowest point: a ground filter, useful for removing vegetation from a ground survey. Applied to a stockpile, it lowers the surface and underestimates the volume. In the test of section 7.4 its bias was ten times that of the median. It is therefore not used for photogrammetry.
  • Point closest to the cell centre: used for clean surveys.

Volume computation

3.1 Base

Volume is measured between the top surface zt and a base zb, inside a polygon Ω defined by the user. There are four kinds of base:

  • Horizontal plane at a given elevation.
  • Plane fitted to the toe by least squares: zb=a(x−x¯)+b(y−y¯)+c, fitted to the top elevations sampled along the boundary. Coordinates are centred so the normal equations stay well conditioned. The root-mean-square residual of the fit enters the base uncertainty (section 4).
  • Boundary base: a TIN built from the boundary elevations and triangulated with the ring itself as a constraint. In concave L- or U-shaped polygons, no base triangle crosses the re-entrant part. The boundary is sampled with up to 2,000 vertices, spread in proportion to each side's length.
  • Another surface: an earlier survey, a pit design or the natural ground. This is how two dates are compared.

3.2 Exact integration by overlaying triangles

The difference d=zt−zb separates fill (material above the base) from cut (void below it):

F=∫Ωmax(d,0)dA,C=∫Ωmax(−d,0)dA,N=F−C

When the top is a TIN and the base is a plane, another TIN or the boundary base, the volume is computed without a grid and without discretisation error, in four steps:

  1. Polygon decomposition. The polygon Ω is split into convex parts by ear removal, so a clip never joins two arms of a concave polygon.
  2. Overlay. Each convex part is clipped by each top triangle with the Sutherland–Hodgman algorithm (1974). When the base is a TIN, the piece is clipped again by each base triangle. Candidate triangles come from the spatial index.
  3. Split at d = 0. Within each piece R, top and base are linear, and so is d. The piece is split along the line d=0 into a positive part and a negative part.
  4. Exact integration. The integral of a linear function over a polygon is exact by the centroid formula. For each fan triangle of a piece:
∫TddA=A(T)·d1+d2+d33

The sloped surface area comes out at the same time: As=∑A(R)1+zx2+zy2. The mean stockpile height is F divided by the area where d>0, with a strict inequality, so faces lying exactly on the base do not dilute the mean. The area covered by the clips is also tracked, and the fraction of the polygon with no top or base elevation is reported as coverage.

3.3 Grid integration (raster models)

When the top or the base is an elevation grid (GeoTIFF), both surfaces are sampled on a common grid. The default cell is the smaller of ¼ of the sample spacing and 0.5 m, with a 1 cm minimum and a 2 million cell ceiling. Each cell is integrated by midpoint quadrature on 4 × 4 nodes. At the polygon edge, only interior nodes count. This reduces the aliasing that a single sample per cell produces on periodic or narrow features (section 4).

3.4 Material: stockpile or pit

A stockpile is measured in its loose state and a pit in its natural (bank) state. The swell factor fe=1+e links the two. Applying fe to a stockpile that is already loose would count swell twice. The user therefore chooses what is being measured, and the app applies:

Stockpile:M=F·ρloose,Vbank=F/fePit:M=C·ρbank,Vloose=C·fe

In cut and fill mode the main result is the net N, shown together with F and C. The app offers typical densities and swell factors from earthmoving tables (Caterpillar), always editable, and recommends testing the actual material.

Volume uncertainty

The uncertainty is computed for each quantity Q: fill, cut, net or moved volume. The total combines the terms in quadrature, like the independent standard uncertainties of the GUM (JCGM 100:2008):

σQ=σbase2+σresolution2+σscale2+σnoise2
  • Base (systematic vertical error). The base is shifted by ±σz and the volume is integrated again: σbase=max|Q(zb±σz)−Q|. Re-integrating follows the moving line between cut and fill and only counts the area that has elevations.
    • σz combines the RMSE of the fitted plane and of the control points with the typical precision of the source: 2 cm for surveys, 3 cm for LiDAR and 5 cm for photogrammetry.
    • Two independent epochs add in quadrature, σt2+σb2.
    • When both epochs share the same vertical reference, the common bias cancels in the difference and is not added.
  • Resolution, grid only:
    σresolution=max(|Q(c)−Q(2c)|,|Q(c)−Qφ(c)|,|Q(c)−Qln2(c)|)
    The shifted grids are translated on both axes by two irrational fractions of the cell: φc, with φ=(5−1)/2≈0.618, and (ln2)c≈0.693c. Comparing only c with 2c fails on a periodic surface whose period divides the cell: both grids sample the same phase and are wrong together. The shift breaks that coincidence, as long as it is not a simple rational fraction of the cell. With c/2, the surface d=1−cos(4πx) still aliases. With c/3, 1−cos(48πx) aliases, because all nodes sit on multiples of c/24. An irrational shift matches none of these lattices. Two are used because, with a coarse cell, a single shift can still land on a favourable phase by chance. With exact triangle integration this term is zero.
  • Scale. A linear scale s multiplies every volume by s3. For a relative error σs, then, σscale≈3σs|Q| for each quantity: 3σsF, 3σsC, 3σs|N| and 3σs(F+C). A 1 % scale error becomes 3 % of the volume. Without verified scale, σs=3% is assumed and the result is flagged as an estimate. With verified scale, the residual measured on the control is used.
  • Independent vertex noise. When a per-vertex standard deviation σv is given for the TIN, the volume is linear in the vertex elevations, with weights wi equal to the integral of each vertex's basis function. Hence σnoise=σv∑iwi2. Independent noise shrinks as vertices are added; systematic base error does not.

In cut and fill mode the main uncertainty is that of the net N. The moved volume F+C is unsuitable: when the base shifts, cut grows by almost as much as fill shrinks, and the error would cancel to first order. In a balanced case with σz=5 cm, this would cut it from 5 m³ to 0.125 m³. The independent review found exactly this defect, and it was fixed.

The percentage shown is always relative to the reference quantity:

  • F for a stockpile;
  • C for a pit;
  • F+C for cut and fill.

It is never computed on the net. With balanced cut and fill the net tends to zero, and a percentage of it would be meaningless.

How the surface is obtained

5.1 Surveys and files

GNSS points, LandXML, 3D DXF, GeoPackage, Shapefile, LAS, PLY, OBJ and elevation GeoTIFF, in any coordinate system supported by the app's CRS engine.

5.2 LiDAR (iPhone and iPad Pro)

Capture uses ARKit scene reconstruction, which fuses the LiDAR sensor depth into a 3D mesh. The session is aligned with gravity and with true north, when a compass is available. The mesh is turned into a point cloud and positioned in one of two ways: by the device GNSS (quick mode) or by control points. In the second case, a 7-parameter 3D similarity transform is fitted by least squares (Horn, 1987; Umeyama, 1991), and each point's residual is reported. Scale is only considered verified with three or more control points.

5.3 Photogrammetry processed on the device (Android)

The user photographs around the pile. All processing happens on the phone, in this sequence:

  1. Feature points: photos are reduced to 2,000 px on the longer side, keeping the camera metadata. SIFT keypoints (Lowe, 2004) are detected in each photo.
  2. Matching and epipolar geometry: keypoints are matched between photo pairs, and inconsistent matches are rejected by RANSAC on the fundamental matrix (Fischler and Bolles, 1981; Hartley and Zisserman, 2004).
  3. Camera positioning (incremental structure from motion): camera poses and calibration are estimated and refined by bundle adjustment, with the OpenMVG library (Moulon et al., 2013; 2016).
  4. Dense cloud: multi-view stereo depth maps with per-view neighbour selection (Goesele et al., 2007), implemented in the MVE library (Fuhrmann, Langguth and Goesele, 2014). Depth maps are computed at half resolution, which in our test gave the best balance between time and accuracy (section 7.7). They are then fused into a single point cloud.
  5. Scale, vertical and position: the reconstruction has arbitrary scale and arbitrary axes. Scale comes from printed ArUco targets (Garrido-Jurado et al., 2014), detected in each photo with sub-pixel corner refinement. Each target centre is triangulated by least-squares intersection of the rays of the cameras that see it. There are two modes:
    • known distance: the scale factor is the measured distance between targets 0 and 1 divided by the reconstructed distance;
    • control points: 7-parameter similarity between the triangulated targets and the measured coordinates, with the RMSE reported.
    The vertical axis comes from the plane of the targets (three or more, on the ground) or from the dominant base plane, found by RANSAC. Position and heading come from the photos' GPS, when present; in that case only the rotation about the vertical and the translation are fitted, so the metre-level GPS error does not contaminate the target scale.

When the surface is published, the dense cloud is reduced by the per-cell median elevation (section 2), not by the lowest point, which would lower the stockpile. Scale is only flagged as verified when each target appears in at least three photos (distance mode) or when the control-point RMSE is below 5 cm. Otherwise the volume is reported as an estimate.

Focal length from EXIF (version 2.2). Camera positioning needs an initial focal length in pixels. It comes from the sensor width of the phone model when the model is in the sensor table. When it is not, which is common for phones released after the table, the 35 mm equivalent focal length stored in EXIF is used. It is defined by the diagonal of the 36 × 24 mm frame:

fpx=f35·W2+H243.27 mm

Here W and H are the photo width and height in pixels. Bundle adjustment then refines this value. Before this rule, photos from a model missing from the table had no calibration and the reconstruction failed.

5.4 Global models

The Copernicus GLO-30 model (30 m resolution) can be downloaded for regional profiles, contours and sections. Volume computation is blocked on it, because its resolution is incompatible with stockpiles and pits.

5.5 Volume wizard and automatic reference

The tool now opens with a three-step wizard: how to measure (photos, LiDAR or file), capture, and see the volume. The survey is created automatically. When the capture carries a GPS position, the WGS 84 / UTM zone of that point is used (EPSG 326zz in the northern hemisphere and 327zz in the southern), with the ellipsoidal height measured by GPS, which is what the phone actually measures. Without GPS, coordinates are local, in metres, with local heights. This does not change the volume, which depends only on height differences inside the polygon. Reference systems remain editable in full mode, from lists with explanations: GPS height, EGM2008, Imbituba and Santana (MAPGEO2015), NAVD 88, EVRF2019 or local height.

5.6 Guided capture in the app

The app's own camera tracks the position of every photo. On Android the pose comes from ARCore when the device supports it; otherwise only the compass and the tilt from the rotation sensor are used. On iPhone and iPad the pose comes from ARKit. The walk around the object is split into 16 azimuth sectors and two height bands (low and high), and each photo marks the sector it was taken from. With AR tracking, the object centre is estimated as the least-squares point closest to the cameras' central rays, with origin pi and unit direction di:

c^=(∑i=1n(I−didiT))−1∑i=1n(I−didiT)pi

Without AR, the user's sector is the camera heading plus 180°. Sharpness of each photo is the variance of the Laplacian on a thumbnail; blurred photos are flagged for a retake. Hints follow a fixed order: retake a blurred photo, complete the missing side, move up to the high band and finally report that coverage is complete. The minimum is 20 photos (ideally 30 to 60), and finishing with less than 80 % coverage requires confirmation.

Automatic recording (version 2.2). Taking photos one by one proved tedious for people who are not photogrammetrists. With AR tracking active, the default mode is now record: the user taps the red button and walks slowly around the object, aiming at the centre, and the app decides on its own when to keep each frame, from the AR pose read every 100 ms. The rules are:

  • Once the object centre is estimated, a frame is kept when the user's position around the centre advances 8° since the last kept frame, or when the phone height changes by 0.3 m. Without a centre, a frame is kept every 0.25 m of travel.
  • In either case, a 12° camera turn also keeps a frame.
  • Above 0.6 m/s of travel or 40°/s of rotation, no frame is kept and the screen asks the user to slow down. The reason is motion blur.
  • Frames are at least 300 ms apart. Frames whose sharpness is below the threshold (variance of the Laplacian, as for manual photos) are discarded.
  • Recording stops by itself at 100 frames, to keep on-phone processing within about 20 minutes.

Using the angle around the centre, rather than the distance walked, keeps the number of frames per lap almost the same for a 2 m object and for a pile with an 8 m radius (section 7.13). Coverage hints still work while recording. Photo-by-photo capture is still available. On Android, the image comes straight from the ARCore camera frame with its pose, not from a second camera, so the photo and the measured position belong to the same instant.

5.7 Photogrammetry processed on iPhone and iPad

On iOS 17 or later, photos from the guided capture are reconstructed on the device by RealityKit's PhotogrammetrySession (Apple). The result is converted into a coloured point cloud with the vertical axis up. Scale comes from the metric ARKit poses stored with each photo: we fit the scale s, the rotation θ about the vertical and the translation t that take the reconstructed camera centres ri to the ARKit positions ai (Umeyama, 1991), with three or more cameras:

mins,θ,t∑i=1n‖ai−(sRz(θ)ri+t)‖2

Rotation is restricted to the vertical axis because ARKit already aligns gravity. Without poses, scale comes from ArUco targets 0 and 1, detected on the device, as on Android.

5.8 Scale from the phone's motion (ARCore)

The reconstruction has an arbitrary scale. ARCore, in turn, measures the phone's path in metres by combining the camera and inertial sensors. During guided capture, the ARCore position ai is stored with each frame. After the reconstruction, which gives each camera centre ri, the scale in metres per unit is the median of the distance ratios between pairs of cameras:

s=med(i,j)∈P‖ai−aj‖‖ri−rj‖,P={(i,j):‖ai−aj‖≥0.2 m}

Pairs closer than 0.2 m are left out because noise dominates the ratio. The median resists bad pairs. The scale is accepted only if the relative spread of the ratios is small:

D=med(i,j)∈P|sij−s|s≤0.08,p′=c+sσT(p−c)

At least 6 cameras with both positions and 12 valid pairs are required. A relocalisation of a few decimetres in the middle of the capture is absorbed by the median. Positions unrelated to the photos, however, spread the ratios, and the scale is rejected (section 7.14). Once the scale is accepted, each cloud point p and each camera is adjusted about the camera centroid c, where σT is the scale of the transform already applied to the reconstruction (for example, the GPS one). GPS therefore still gives position and heading, and ARCore gives size. Printed targets, when present, take priority and ARCore scale is not used. With the scale accepted, the result is marked as verified scale and the screen says the scale came from the phone's motion.

Tool design and 3D view

The design started from field use: gloves, strong sun and little time. Three decisions follow from that:

  • Marking with a crosshair. The polygon is marked on a plan view that zooms and pans with two fingers. A new point goes in at the fixed crosshair in the centre of the screen, through a large button, not by tapping the map. The finger therefore never hides the spot being marked, and a stray tap never creates a vertex. Vertices can be dragged, deleted one by one and undone. Crossing edges turn red, and the computation is only enabled once they are fixed.
  • Large photogrammetry areas. The interactive surface holds up to 10 thousand vertices. On a capture a few hundred metres across, the reduction cell grows beyond 1 m and the volume of a small stockpile loses precision: −1.5 % in the test of section 7.4. The app warns when the cell exceeds 0.5 m. For stockpiles, capture only the stockpile and its immediate surroundings.
  • Correlated error. The uncertainty treats base error as fully systematic and vertex noise as independent. Error with intermediate spatial correlation, such as LiDAR drift or photogrammetric doming without control points, is not modelled: the uncertainty may come out above or below the actual error.
  • Raster models. Raster grid elevations are stored in single precision. At elevations of hundreds of metres, differences below 1 mm are not represented. This does not matter for stockpiles and pits, but rules out using the grid for sub-millimetre measurements.
  • Suggested toe. The app proposes the stockpile or pit outline from the surface itself, in four steps:
    1. it fits a robust plane to the outer ring of the area, which is the surrounding ground, with two rejection passes based on the median absolute deviation;
    2. it marks the cells whose height above that plane exceeds the largest of three standard deviations of the surroundings, 10 % of the relief and 5 cm;
    3. it keeps the largest connected region and grows it outwards while the height above the surroundings exceeds 2 standard deviations (at least 2 cm), out to the real toe; it fills holes and dilates by one cell;
    4. it traces the outer contour and simplifies it by Douglas–Peucker (1973), with a 0.9-cell tolerance, inside the dilation margin.
    On a 754 m³ conical stockpile on flat or sloping ground (2 % and 8 %), the volume with the boundary base and the suggested toe was 750.7 m³ (−0.4 %); the same held for an equivalent pit. The first version stopped at the detection threshold and gave 602 m³. The error was found when testing the screen on a device, and fixed. The proposal can always be edited before computing.
  • Result matched to the task. The headline depends on what is measured: the volume above the base for a stockpile, the excavated volume for a pit, and the net for cut and fill. The screen also shows coverage, the method (exact on the TIN or grid), the breakdown of the uncertainty and the scale badge. The badge comes from the capture metadata and cannot be switched on by hand. The report comes out as PDF, text and CSV.

6.1 3D view

After computing, the volume appears in 3D. One finger orbits the view. Two fingers zoom, pan and rotate, with the zoom anchored at the point between the fingers. A double tap returns to the initial view. There are four colour modes:

  • hypsometric relief;
  • cut and fill, on a diverging scale: orange for material above the base, blue for below and grey near zero;
  • neutral shading;
  • solid: only the ground inside the polygon, with side walls from base to top, so the volume reads as a block.

Vertical exaggeration goes from 1× to 10×, with a north arrow and a scale bar.

Rendering is the same on Android and iOS and runs entirely on the device GPU, with no external 3D library. The surface is resampled on a regular grid of up to 254 × 254 cells in full screen, about 129 thousand triangles, in local coordinates. The projection is orthographic, as in an axonometric survey view: on-screen measurements do not depend on distance.

Because terrain is a height field, each plan position has a single elevation, and occlusion is resolved without a depth buffer by the painter's algorithm (Foley et al., 1990). Cells are drawn from the side away from the camera towards it. Within each cell, the farther triangle comes first, according to the sign of cxΔx−cyΔy, where c is the camera direction. The eight possible orders are computed once. Each frame only re-projects the vertices; colours and shading (light from the north-west at 45°) are cached. In solid mode the order is: walls facing away, top, walls facing the camera.

6.2 Real colour and camera positions

The Real colour mode paints the surface with the colours of the photos or LiDAR. The colour of each cloud point is aggregated on a regular grid by the per-channel median of the samples in each cell, which resists stray points of another colour. Holes of up to 2 cells are filled with the mean of their neighbours, and the grid has at most 512 × 512 cells. On screen, colour is interpolated bilinearly and receives soft diffuse shading so that relief remains readable. With iPhone LiDAR, each vertex is projected into the ARKit camera frame, with a depth test so that colour is not taken from objects in front, and converted from YCbCr to RGB. The colour grid is for display only and never enters the volume computation.

The view now orbits down to 60° below the horizon. From below, the bottom face of the solid, which is the base used in the computation, and the side walls are shown. The base is labelled, for example “plane fitted to the toe”. The reconstruction's camera positions can be shown as cones pointing at the surface. There are preset views: top, front, side, below and perspective.

6.3 Cloud for the screen

The dense cloud from a 60-frame capture can exceed 4 million points, about 130 MB in binary, more than the memory Android reserves for the app. For import and the 3D view, the cloud is read as a stream with constant memory and reduced by systematic sampling (1 in N points) to at most 250 thousand points, with colour. ARCore scale is applied in the same pass. The volume surface is built from this sample, using the per-cell median (section 2). With a typical spacing of a few centimetres on a pile of a few metres, 250 thousand points still leave several samples per cell.

Validation

7.1 Solids with analytical volume

Each case runs on exact triangle integration (TIN) and on the raster grid. Curved solids use meshes of 0.1 to 0.2 m. Values in m³:

CaseExact valueTINGridRelative error
Pyramid 10 × 10 × 6 m200200.000000—0
Cone R = 4, H = 316π = 50.265550.249950.24963.1×10−4
Frustum R = 5, r = 2, H = 339π = 122.5221122.4969122.49952.1×10−4
Paraboloid R = 5, H = 450π = 157.0796157.0377157.04372.7×10−4
Spherical cap R = 5, h = 336π = 113.0973113.0423113.04284.9×10−4
Sine × sine, A = 1, L = 10 (fill = cut)200/π² = 20.264220.250920.26096.6×10−4
Plane z = 0.2x − 1 on 10 × 10 (fill = cut)2525.00000025.000000<10−8
Sloped plane over a fitted base 5 m below500500500.000001<10−8
Two TINs with opposite diagonals (cut)100100—0
Concave U-shaped polygon152152.000000152.000000<10−8
Two epochs, +1.25 m over 100 m², different meshes125125—0

The opposite-diagonals case shows why integration must overlay both meshes. The two surfaces share their vertices but are triangulated differently. On a grid the result would be 102, 100.5 and 100.125 m³ for 1, 0.5 and 0.25 m cells. The overlay gives exactly 100 m³.

Invariance. The same survey was translated to UTM coordinates (500,000; 7,500,000), rotated by 37°, 90° and 143°, and had its boundary orientation reversed. The volume changed by at most 4×10−11 in relative terms. The area of a 10 cm square at those coordinates was 0.00999999996 m².

Aliasing. On the surface d=1−cos(4πx) over 10 × 10 m, whose exact volume is 100 m³, one sample per 1 or 2 m cell gives 0 m³ with zero resolution uncertainty: the worst possible error, because it is invisible. With 4 × 4 quadrature and the shifted grid:

  • with 1 m cells the result is 100 m³;
  • with 2 m cells it is 200 m³ with a resolution uncertainty of 200 m³.

The number is still wrong at that coarse cell, but the uncertainty exposes it.

Materials. A 200 m³ pit with ρ = 1.8 t/m³ and 25 % swell gives 360 t and 250 m³ loose. A 200 m³ stockpile with the same swell corresponds to 160 m³ in bank. A non-positive density or a negative swell blocks the computation.

7.2 Independent verification

A second integrator was written from scratch, in another language (Python, standard library only) and without access to the engine code. It uses polygon decomposition, convex clipping and an exact split at d=0. Each closed-form value was also checked by Gauss–Legendre quadrature of the continuous function. On the 27 generated cases (all those in the table above, invariances, a global-model base, a pit with material and aliasing), closed forms and quadrature agree to 10−13 m³. This verification found that the c/2 shift, and then the c/3 shift, still alias on chosen periodic surfaces. The released version uses the irrational shifts of section 4. In the same review, the engine ran the 27 cases and agreed with the independent integrator to 7×10−12 m³. The review also proved defects that were fixed before release: uncertainty cancellation in cut-and-fill mode, the top uncertainty being dropped when a base uncertainty was given, the second epoch's noise being ignored when comparing dates (83 % coverage, now 93.5 %), and surfaces with invalid elevations not being blocked.

7.3 Does the uncertainty cover the error? (Monte Carlo)

A regular 11 × 11 vertex mesh over 10 × 10 m, with its top at 2 m and a volume of 200 m³, received independent Gaussian noise of 5 cm per vertex in 200 realisations. This was repeated with three seeds. Results:

  • the noise uncertainty reported by the engine (0.500 m³) matches the analytical formula and the observed spread (0.491 to 0.511 m³);
  • the ±1.96σ interval contained the error in 93.5 %, 94.5 % and 95.0 % of the realisations, for a nominal 95 %;
  • the mean showed no significant bias.

7.4 Photogrammetric cloud reduction

A synthetic dense cloud of a 16π m³ cone, with 2 cm noise, was reduced to 0.25 m cells, triangulated and measured:

  • with the per-cell median, the volume was 50.18 m³ (−0.17 % error), with an elevation bias of −2.3 mm;
  • with the lowest point per cell, which was the previous photogrammetry rule, it was 49.20 m³ (−2.1 %), with a −2.3 cm bias, ten times larger.

Real cloud with an injected stockpile. A frustum of known volume, 388π/3 ≈ 406.31 m³, was added to the real Aukerman cloud (915,977 points, UTM 17N). The app's full path (reduction, triangulation and volume) recovered that volume as follows:

  • with 0.5 m cells over the stockpile area, a −0.03 % error and a −3 mm elevation bias;
  • with 1 m cells, a −0.35 % error;
  • with the whole 325 × 259 m cloud reduced to the 10-thousand-vertex cap of the interactive surface, a −1.5 % error and a −7 cm bias. The cell is then about 3 m and smooths the stockpile crest (see limitations).

7.5 3D viewer

Occlusion. An automatic test rasterises each triangle in painter's order and compares it, pixel by pixel, with the face of greatest depth. The test surface has a ridge with steep slopes under 5× vertical exaggeration. Across 72 views (azimuths 0° to 345° in 15° steps, and elevations of 5°, 35° and 70°), no interior pixel showed the wrong face. The first version of the renderer, which used the same order for both triangles of a cell, was wrong in about half of the azimuths. That error was caught in cross-review and fixed.

Performance on a Snapdragon 870 phone with a production build, orbiting at 40°/s with 2× exaggeration:

MeshTrianglesFrames past deadlineGPU (p95)
254 × 254 (full screen)≈129k0 %3 ms
Solid mode, 316 × 316polygon only0 %3 ms
316 × 316 (outside normal use)≈200k28 %4 ms
200 × 200, Android 8–9 (software drawing)≈80k≈32 frames/s—

The display mesh is therefore capped at 254 × 254. Volume is always computed on the original surface, never on the display mesh. On an iPhone XS Max (A12 chip, 2018), with the same scenario and the same shared code, the view held 60 frames per second with no frame above 16.7 ms, with both 129 thousand and 200 thousand triangles.

7.6 Photogrammetry reference

As a reference we used OpenDroneMap 3.6.2 on a server, at high quality. It is an established pipeline that uses OpenSfM for cameras and OpenMVS for the dense cloud. The test set is dataset_banana, published by the OpenDroneMap project: 16 photos of 3,008 × 2,000 px taken around an object on a table, a capture geometry analogous to a stockpile's. The two clouds were aligned by similarity: first by camera positions, then by trimmed ICP. The volume above the table plane, found by RANSAC, was compared over the object footprint.

7.7 Result on the phone

Test phone: Snapdragon 870, 8 GB RAM, Android 13.

ConfigurationTotal timePeak memoryCoverageVolume vs reference
App (full processing on the device)2 min 24 s≈ 1.6 GB98.8 %−0.7 %
Study: half-resolution depth maps, 8 cores3 min 32 s≈ 1.5 GB99.1 %−0.9 %
Study: full-resolution depth maps, 8 cores10 min 47 s≈ 1.6 GB95.4 %−4.5 %
Study: half resolution, only the 4 smaller cores (simulated mid-range phone)10 min 53 s≈ 0.8 GB——

In the app's cloud, the distance between the phone and reference surfaces had a median of 0.33 % of the object height, and 90 % of points were below 0.68 %. Differences concentrate at the object edges.

7.8 Target scaling

  • Real reconstruction with projected targets. We projected targets 0 and 1 with correct perspective into the real photos, at a known distance, using the reconstruction's own calibration. They were detected in 12 and 11 photos. The triangulated distance differed from the truth by 0.064 %, and the scale factor was recovered with the same error. In the full on-phone processing (photos, cameras, dense cloud and scale), scale was verified, and the targets, which lie on the base plane, ended about 1 mm from it after levelling.
  • Drone flight at 110 m (22 real cameras). 1 m targets were detected in all 9 photos where they were visible, with 4 to 7 mm triangulation error, and the requested scale of 1.05 was recovered as 1.0506. 0.2 m targets (about 7 px in the photo) were not detected. Hence the rule of thumb: a target must cover at least about 20 pixels in the photo.

7.9 Negative result

On an aerial set of a park with lawn and trees (24 public OpenDroneMap photos), volumes in 40 × 40 m boxes diverged from the reference by between −46 % and +131 %, even after aligning the clouds by ICP: the residual shift was 0.11 m and the rotation 0.22°. In that relief, the mean height above the base was only 0.2 to 0.6 m, the same order as the noise at tree canopies and edges, and the percentage difference loses meaning. We conclude that the method is suited to objects with well-defined relief relative to the base, such as stockpiles, pits and slopes, and not to measuring the "volume" of nearly flat vegetated ground.

7.10 Capture centre with noisy poses

We simulated 24 photos on a 5 m-radius circle, with the camera 1.5 m high aiming at the centre on the ground. Gaussian noise of 3° in heading, 2° in tilt and 3 cm in each coordinate was added to the poses. In 500 repetitions with a fixed seed, the centre was found every time. The distance to the true centre had a median of 0.091 m, a 95th percentile of 0.178 m and a maximum of 0.292 m. This centre only orients the sectors on the capture screen and does not enter the reconstruction.

7.11 Scale from ARKit poses

A synthetic reconstruction was generated at scale 0.37 and rotated 40° about the vertical. We used 30 cameras on a 6 m circle, at two heights (1.2 and 2.4 m), with Gaussian noise of 2 cm in each coordinate of the metric positions. Over 500 repetitions, the relative scale error had a median of 0.040 %, a 95th percentile of 0.122 % and a maximum of 0.204 %. Since volume varies with the cube of scale, this corresponds to about 0.12 % (median) and 0.6 % (maximum) in volume. The test does not include ARKit's accumulated drift in long captures.

7.12 Colour grid

On a synthetic cone coloured by cell, the recovered colour was at most 2 levels (out of 255) from the source colour in each channel. Holes of up to 2 cells were filled and larger ones stayed empty, as intended. Writing the grid to a file and reading it back returned the same bytes. The occlusion test of section 7.5 was repeated at elevations of −60°, −30° and 0° for the view from below, with no pixel showing the wrong face.

7.13 Automatic recording

We simulated full laps on foot, at 0.3 m/s, around objects with radii of 2, 5 and 8 m. The pose was sampled at 10 Hz with noise of 0.5 cm in position and 0.5° in heading and tilt, with 200 repetitions per radius and a fixed seed:

  • 2 m radius: median of 43 frames (from 42 to 43); largest angular gap between neighbouring frames of 9.2° at the 95th percentile and 9.5° at most;
  • 5 m radius: median of 44 frames (from 44 to 45); largest angular gap between neighbouring frames of 8.5° at the 95th percentile and 8.7° at most;
  • 8 m radius: median of 45 frames (from 45 to 45); largest angular gap between neighbouring frames of 8.3° at the 95th percentile and 8.4° at most;
  • at 1.2 m/s, too fast, no frame was kept in 50 laps.

The number of frames per lap does not depend on the object size, as intended.

7.14 ARCore scale with noisy poses

The synthetic reconstruction was generated at scale 0.37 and rotated 40° about an oblique axis. We used 54 cameras in two laps, as in recording: 32 at a 1.9 m radius and 1.0 m height, and 22 at 1.3 m and 1.6 m. The ARCore positions received Gaussian noise in each coordinate, with 500 repetitions per noise level:

  • 1 cm noise: 500 of 500 accepted; scale error with a median of 0.06 %, a 95th percentile of 0.16 % and a maximum of 0.28 %;
  • 2 cm noise: 500 of 500 accepted; scale error with a median of 0.12 %, a 95th percentile of 0.33 % and a maximum of 0.50 %;
  • 5 cm noise: 500 of 500 accepted; scale error with a median of 0.27 %, a 95th percentile of 0.74 % and a maximum of 1.09 %;
  • with a 0.5 m relocalisation in the middle of the capture, all 200 scales were accepted, with a median error of 0.35 % and a maximum of 0.69 %: the median absorbs the shift;
  • with the ARCore positions shuffled between frames, simulating tracking unrelated to the photos, 0 of 200 scales were accepted: the spread limit rejected the others.

The test does not include ARCore's own scale bias or drift. Those errors pass straight into the result, and volume varies with the cube of scale.

7.15 Test with a real object and a negative result

In a guided capture of a ball with 61 ARCore frames, all cameras were calibrated and processing took about 15 min on the Poco F3. The dense cloud had 4.7 million points and exhausted the app's memory when the 3D view opened. That defect led to the streamed reduction of section 6.3. Before the EXIF focal length rule (section 5.3), in an earlier capture of 47 photos on the same phone, whose model was not in the sensor table, no photo was positioned.

Limitations and conditions of use

  • Scale. Phone photos do not have GPS accurate enough to give a stockpile's scale. Use printed targets or a measured distance. Without them, the volume is only an estimate.
  • Capture. 12 to 150 photos, with 70 to 80 % overlap, from two height levels, including the toe of the pile. Textureless, reflective or wet surfaces, hard shadows and moving objects degrade the reconstruction.
  • Device. Offline photogrammetry on ARM64 Android with at least 4 GB of memory (6 GB recommended). The time for mid-range phones is an estimate made by restricting cores on the test phone, not a test on an actual mid-range device.
  • LiDAR. Useful range of about 5 m. Drift grows on long scans; we recommend areas of up to about 30 × 30 m per scan.
  • Reference. Photogrammetry validation used an established server pipeline as the reference, not a physically measured volume. A field test with stockpiles of known volume is planned, and this text will be updated with the results.
  • Raster grids. On raster models, a feature smaller than the cell can escape sampling. The resolution uncertainty exposes the detectable cases (section 7.1), but a raster that arrived already flattened cannot be corrected. Prefer the survey or point-cloud TIN when available.
  • Large photogrammetry areas. The interactive surface holds up to 10 thousand vertices. On a capture a few hundred metres across, the reduction cell grows beyond 1 m and the volume of a small stockpile loses precision: −1.5 % in the test of section 7.4. The app warns when the cell exceeds 0.5 m. For stockpiles, capture only the stockpile and its immediate surroundings.
  • Correlated error. The uncertainty treats base error as fully systematic and vertex noise as independent. Error with intermediate spatial correlation, such as LiDAR drift or photogrammetric doming without control points, is not modelled: the uncertainty may come out above or below the actual error.
  • Raster models. Raster grid elevations are stored in single precision. At elevations of hundreds of metres, differences below 1 mm are not represented. This does not matter for stockpiles and pits, but rules out using the grid for sub-millimetre measurements.
  • Suggested toe. The outline suggestion is driven by relief and may include neighbouring slopes or leave out low parts of the stockpile. Always check the polygon before computing.
  • 3D view. The 3D view is a display resampling of up to 254 × 254 cells. The computation always uses the original surface. On Android 8 and 9, the 3D view is drawn in software and runs slower. In solid mode, on a concave polygon seen from certain angles, a far wall can appear over the nearer top. This affects only the picture, not the volume.
  • GPS georeferencing. Supported in the WGS84 and SIRGAS 2000 UTM zones. In other systems the result stays in local coordinates, which does not affect the volume.
  • Beta features. Guided capture, reconstruction on iPhone and real colour were validated by automated tests and builds for both systems, but not yet by a field test with a known volume. The sharpness and coverage thresholds will be calibrated in the field.
  • Automatic scale on Android. In guided capture with ARCore, scale comes from the phone's motion (section 5.8) and inherits the tracking scale error. Photos picked from the gallery, without ARCore positions, still get GPS scale, as an estimate only. For contractual measurement, use the targets.
  • Automatic recording. Only available with AR tracking (ARCore or ARKit). Without it, capture is photo by photo. The limit is 100 frames per capture, and the screen shows up to 250 thousand cloud points.
  • Reconstruction on iPhone. Requires iOS 17 or later and a device supported by PhotogrammetrySession. The app says when the device is not supported.
  • Automatic reference. The phone GPS ellipsoidal height is off by a few metres in absolute terms. This does not affect the volume within one capture, but it prevents comparing two dates measured only with the phone GPS. To compare dates, use control points or targets.

Third-party software and licences

On-device processing uses open libraries, under licences compatible with commercial distribution:

  • OpenMVG, camera positioning: Mozilla Public License 2.0. Source code at github.com/openMVG/openMVG.
  • MVE, dense cloud: 3-clause BSD licence. Source code at github.com/simonfuhrmann/mve.
  • OpenCV, target detection: Apache 2.0. Eigen: MPL 2.0. Ceres Solver: BSD.
  • Guided capture: ARCore (Google Play Services for AR), by Google LLC, under the ARCore Additional Terms of Service, free and proprietary; CameraX (Android Jetpack): Apache 2.0. On iOS, ARKit and RealityKit, Apple system frameworks.

Volume computation, uncertainty propagation, the scale, vertical and georeferencing logic, and the integration in the app are Thard Tech's own development.

References

  1. 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.
  2. Fuhrmann, S.; Langguth, F.; Goesele, M. (2014). MVE — A multi-view reconstruction environment. Eurographics Workshop on Graphics and Cultural Heritage.
  3. Garrido-Jurado, S.; Muñoz-Salinas, R.; Madrid-Cuevas, F. J.; Marín-Jiménez, M. J. (2014). Automatic generation and detection of highly reliable fiducial markers under occlusion. Pattern Recognition, 47(6), 2280–2292.
  4. Goesele, M.; Snavely, N.; Curless, B.; Hoppe, H.; Seitz, S. M. (2007). Multi-view stereo for community photo collections. IEEE International Conference on Computer Vision (ICCV).
  5. Hartley, R.; Zisserman, A. (2004). Multiple View Geometry in Computer Vision, 2nd ed. Cambridge University Press.
  6. Horn, B. K. P. (1987). Closed-form solution of absolute orientation using unit quaternions. Journal of the Optical Society of America A, 4(4), 629–642.
  7. Lowe, D. G. (2004). Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision, 60(2), 91–110.
  8. Moulon, P.; Monasse, P.; Marlet, R. (2013). Adaptive structure from motion with a contrario model estimation. Asian Conference on Computer Vision (ACCV 2012), LNCS 7727.
  9. Moulon, P.; Monasse, P.; Perrot, R.; Marlet, R. (2017). OpenMVG: open multiple view geometry. Reproducible Research in Pattern Recognition (RRPR 2016), LNCS 10214.
  10. Caterpillar Inc. Caterpillar Performance Handbook. Peoria: Caterpillar Inc. Section on material weights and swell (typical values used as editable suggestions).
  11. Douglas, D. H.; Peucker, T. K. (1973). Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. Cartographica, 10(2), 112–122.
  12. Foley, J. D.; van Dam, A.; Feiner, S. K.; Hughes, J. F. (1990). Computer graphics: principles and practice. 2nd ed. Reading: Addison-Wesley.
  13. JCGM — Joint Committee for Guides in Metrology (2008). JCGM 100:2008 — Evaluation of measurement data: guide to the expression of uncertainty in measurement (GUM). BIPM.
  14. Sutherland, I. E.; Hodgman, G. W. (1974). Reentrant polygon clipping. Communications of the ACM, 17(1), 32–42.
  15. Umeyama, S. (1991). Least-squares estimation of transformation parameters between two point patterns. IEEE Transactions on Pattern Analysis and Machine Intelligence, 13(4), 376–380.
  16. 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.
  17. OpenDroneMap. ODM — A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. Version 3.6.2. github.com/OpenDroneMap/ODM.
  18. European Space Agency. Copernicus DEM: global and European digital elevation model (COP-DEM), GLO-30 product. © DLR e.V. 2010–2014 and © Airbus Defence and Space GmbH 2014–2018, provided under COPERNICUS by the European Union and ESA.
  19. APPLE INC. PhotogrammetrySession e ARKit. Developer documentation, RealityKit and ARKit. Available at: developer.apple.com/documentation/realitykit/photogrammetrysession.
  20. GOOGLE LLC. ARCore — Fundamental concepts. Developer documentation. Available at: developers.google.com/ar/develop/fundamentals.
  21. PERTUZ, S.; PUIG, D.; GARCIA, M. A. Analysis of focus measure operators for shape-from-focus. Pattern Recognition, v. 46, n. 5, p. 1415–1432, 2013.
  22. ROUSSEEUW, P. J.; CROUX, C. Alternatives to the median absolute deviation. Journal of the American Statistical Association, v. 88, n. 424, p. 1273–1283, 1993. DOI: 10.1080/01621459.1993.10476408.