1 · Method overview
Photo-sieving (also "photographic granulometry" or "automated grain sizing") infers the
surficial grain-size distribution of a sediment patch from a calibrated photograph by
segmenting individual grains and measuring their projected dimensions. It is an
alternative to physical sieving and Wolman pebble counts, primarily for non-cohesive
gravel and coarser sediment. The pipeline implemented here follows the classical
watershed approach of Graham, Reid & Rice (2005) with refinements from
Detert & Weitbrecht (2012).
2 · Calibration
A known-length scale object in frame (coin, card, ruler) lets you compute the
image scale directly. Tapping its endpoints gives the pixel distance $L_{\rm px}$;
dividing the known length $L_{\rm mm}$ gives:
$\displaystyle s = \dfrac{L_{\rm px}}{L_{\rm mm}} \quad \text{[px/mm]}$
The alternative (camera-intrinsic) calibration uses the pinhole-camera relation
$\;\text{mm/px} = D \cdot p / f\;$ where $D$ is camera-to-subject distance, $p$ is
sensor pixel pitch, and $f$ is physical focal length. Using EXIF's
35-mm-equivalent focal length $f_{35}$ collapses this to
$\;\text{mm/px} = 36000 \cdot D_{\rm m} / (W_{\rm px} \cdot f_{35})\;$ — a single
formula that needs only $D$ and an EXIF tag. This is the "No coin" mode.
Accuracy is limited by how well you measure $D$; a tape from chest to ground gives
~5% error, which propagates linearly to grain size.
3 · Segmentation pipeline
- Bilateral filter ($d=9$, $\sigma_{\rm color}=75$, $\sigma_{\rm space}=75$, Tomasi & Manduchi 1998)
suppresses intra-grain texture (granite speckle, banded gneiss, weathered surfaces) while
preserving stone-to-stone edges. Without this, Otsu thresholds individual mineral grains as
separate "stones" and the watershed downstream over-segments.
- CLAHE (Contrast-Limited Adaptive Histogram Equalization, $8\!\times\!8$ tiles, clip 2.0)
normalizes uneven illumination — critical for outdoor field photos.
- Gaussian blur ($5\!\times\!5$, $\sigma$ auto) suppresses sensor noise without dissolving grain edges.
- Otsu's threshold picks the binarization level that maximizes between-class variance:
$\;\sigma_b^2(t) = w_0(t)\,w_1(t)\,[\mu_0(t)-\mu_1(t)]^2$. Stones > threshold; inter-grain shadow < threshold.
- Morphological open + close ($3\!\times\!3$ kernel) removes salt-and-pepper noise and fills small holes.
- Euclidean distance transform $\;\Delta(x,y) = \min_{(x',y') \in \text{shadow}} \sqrt{(x-x')^2 + (y-y')^2}\;$
gives each stone-pixel its distance to the nearest gap.
- Sure-foreground markers: pixels with $\;\Delta > 0.45 \cdot \max(\Delta)$ — these are the cores of individual grains.
- Watershed transform (Vincent & Soille 1991) floods from the markers to separate touching grains
along ridges of the inverted distance map.
- For each region, minimum-area bounding rectangle gives axis lengths $a \geq b$.
The shorter side $b$ is the intermediate (b-) axis, conventionally used as the
sieve-equivalent size since this is the dimension that controls passage through a square sieve opening.
4 · Distribution statistics
Grain sizes are reported as area-weighted percentiles, which is the
standard photo-sieving convention because larger grains occupy more area and would be over-counted by number.
$D_p$ is the b-axis such that $p\%$ of the total grain area is finer:
$\displaystyle D_p \;\;\text{s.t.}\;\; \sum_{b_i \leq D_p} A_i \;=\; \tfrac{p}{100} \cdot \sum_i A_i$
The phi scale (Krumbein 1934) converts mm to a base-2 logarithmic unit:
$\;\phi = -\log_2(d_{\rm mm})$. This makes log-normal grain-size distributions
appear roughly Gaussian, which is what most natural sediments approximate.
Sorting (Folk & Ward 1957 graphical method, in $\phi$-units):
$\displaystyle \sigma_{\rm FW} = \dfrac{\phi_{84}-\phi_{16}}{4} + \dfrac{\phi_{95}-\phi_5}{6.6}$
Interpretation: $\sigma_{\rm FW} < 0.35$ very well sorted, $0.35\!-\!0.50$ well sorted,
$0.50\!-\!1.00$ moderate, $1.00\!-\!2.00$ poorly sorted, $> 2.00$ very poorly sorted.
5 · Wentworth (1922) size classes
| Class | Diameter (mm) | $\phi$ range |
| Boulder | $> 256$ | $< -8$ |
| Cobble | $64\!-\!256$ | $-8\,$ to $\,-6$ |
| Pebble | $4\!-\!64$ | $-6\,$ to $\,-2$ |
| Granule | $2\!-\!4$ | $-2\,$ to $\,-1$ |
| Sand | $0.0625\!-\!2$ | $-1\,$ to $\,4$ |
| Silt & clay | $< 0.0625$ | $> 4$ |
6 · Known biases & limitations
- Armor-layer bias. Photo-sieving samples only the top, visible grains.
Sub-armor fines are under-represented relative to a bulk sieve sample.
The result reflects the surface grain-size distribution — appropriate for
roughness, mobility, and habitat, but not for full bed-material grading.
- Resolution limit. Grains smaller than ~5 image pixels in b-axis are filtered out
as segmentation noise. At the chosen scale, the smallest detectable grain is
$\;d_{\min} \approx 5 / s\;$ mm. Anything finer falls into a single "matrix" residual
that this method cannot resolve.
- Projection bias. The b-axis is measured in 2-D projection, so a grain lying with
its a-axis vertical (deeply embedded) appears smaller than its true
sieve-equivalent. Empirically this is a 5–15% underestimate; corrections (e.g., Bunte & Abt 2001)
exist but are not applied here.
- Touching-grain over-merge. When inter-grain shadow is faint (uniform lighting,
tightly packed grains, granite speckle), watershed can fail to split touching grains, biasing the result coarse.
Visible as an unusually large segmented region in the overlay.
- Over-segmentation. Heterogeneous grain texture (e.g., banded gneiss, weathered granite)
can produce false internal edges, splitting a single stone into pieces. Visible as
clusters of small adjacent regions on a stone.
- Geometry assumptions. The pinhole / scale-object calibration assumes the
photograph is taken with the camera axis perpendicular to a flat sediment patch.
Tilt $\theta$ introduces a cosine error of order $1 - \cos\theta$ across the frame
(~1.5% at 10°, ~6% at 20°).
- Lighting. Diffuse light (overcast or shade) is best. Direct sun creates harsh
cast shadows that segment as separate "grains."
7 · References
- Graham, D.J., Reid, I., Rice, S.P. (2005). Automated sizing of coarse-grained sediments: image-processing procedures. Mathematical Geology 37(1), 1–28.
- Detert, M., Weitbrecht, V. (2012). Automatic object detection to analyze the geometry of gravel grains — a free stand-alone tool. River Flow 2012, 595–600.
- Buscombe, D. (2013). Transferable wavelet method for grain-size distribution from images. Sedimentology 60(7), 1709–1732.
- Folk, R.L., Ward, W.C. (1957). Brazos River bar: a study in the significance of grain size parameters. Journal of Sedimentary Petrology 27, 3–26.
- Wentworth, C.K. (1922). A scale of grade and class terms for clastic sediments. Journal of Geology 30(5), 377–392.
- Krumbein, W.C. (1934). Size frequency distributions of sediments. Journal of Sedimentary Petrology 4(2), 65–77.
- Bunte, K., Abt, S.R. (2001). Sampling surface and subsurface particle-size distributions in wadable gravel- and cobble-bed streams. USDA-FS RMRS-GTR-74.
- Tomasi, C., Manduchi, R. (1998). Bilateral filtering for gray and color images. Proc. ICCV 1998, 839–846.
- Otsu, N. (1979). A threshold selection method from gray-level histograms. IEEE Trans. SMC 9(1), 62–66.
- Vincent, L., Soille, P. (1991). Watersheds in digital spaces. IEEE Trans. PAMI 13(6), 583–598.