Skip to main content

Blog

Path-Opening Across 39 Thresholds: Recovering Sinusoids Where Hough and Canny Fail

A computer-vision deep-dive on morphological path-opening as an unsupervised baseline for borehole fracture picking. Swept across 39 connectivity thresholds, path-opening recovers three distinct sinusoids in a densely fractured carbonate section where a Canny–Hough pipeline collapses into noise — and it does so before a single label is drawn, setting the floor a supervised Detection Transformer has to beat.

Quamer Nasimby Quamer Nasim9 min read
EarthScan insight

Before you label a single fracture, you should know how far you can get without labels at all. That question is not academic. Across a roughly twenty-month subsurface-AI engagement we ran with a mid-sized Middle East carbonate operator, the supervised Detection Transformer that eventually picked fractures end-to-end was expensive to build: it needed wells, picks, augmentation, and weeks of training. The unsupervised baseline cost almost nothing by comparison, and it set the bar the supervised model had to clear. This piece is about that baseline — specifically, why a classical Canny–Hough edge-detection pipeline falls apart on a densely fractured carbonate interval, and why mathematical morphology, in the form of a path-opening operator swept across 39 connectivity thresholds, recovers the sinusoids that the edge detector buries in noise.

A fracture is a sinusoid, and that is the whole problem

Unroll the cylindrical wall of a borehole into a flat image strip and a planar feature cutting that cylinder traces a sine wave. Its amplitude encodes dip; its phase encodes azimuth. So "detect a fracture" reduces, in image space, to "find and fit a sinusoid." On a clean interval with one well-separated fracture, this is easy: threshold the image, run an edge detector, and let a Hough transform vote for the dominant curve.

The trouble is that productive carbonate is rarely clean. On the two different microresistivity imaging tools' image logs from this field, a fractured interval gives you conductive and resistive fractures, bedding planes, and breakouts crossing and overprinting each other within a two-metre patch — multiple sinusoids of different amplitude and phase, partially occluding one another, riding on a noisy, vuggy background. The classical pipeline was built to find one strong, continuous curve. Ask it to separate three overlapping ones and it does not gracefully degrade. It hallucinates.

IMAGE-LOG GEOMETRY · SCHEMATIC38° / 120°dip steepness · dip azimuthy = A·sin(0.0175·x + φ) + offsetTilt the plane — the cut becomes a sinusoidAmplitude A carries dip steepness; phase φ carries azimuth — the trough points down-dip.plane cut · sinusoid (A = dip)trough = down-dip azimuth (φ)BOREHOLE · A FLAT PLANE CUTS THE CYLINDERN · cutUNROLLED IMAGE · x = AZIMUTH 0–360°, y = DEPTH0°90°180°270°360°Atrough @ 120°DIP 38° · steeper → taller A (25%, schematic)0°30°60°90°AZIMUTH 120°rotates φ — trough swings to thedown-dip compass bearingNSchematic: dip 0–90° & azimuth 0–360° are generic axes, not a well · A=dip, trough φ=azimuth exact
Why every planar feature on an image log is a sinusoid — and how the curve encodes dip and azimuth. A flat plane (bed, fracture, fault) cuts the borehole cylinder on the left; unroll the cylinder against an azimuth axis (0–360°) and the intersection becomes a sine curve on the right. Drag the dip slider and the curve's amplitude A grows as the plane tilts steeper; turn the azimuth knob and the orange trough — the down-dip point — rotates around the borehole, sliding the curve's phase φ. This is the article's own fitting form y = A·sin(0.0175·x + φ) + offset: A carries dip, φ carries azimuth. Pure explainer geometry — dip 0–90° and azimuth 0–360° are generic axis ranges, not client data; the amplitude-to-dip mapping is held in frame near 90° and is labelled schematic.

Where Canny and Hough break

The conventional sinusoid-fitting pipeline we started from is a textbook chain: impute the dead-pixel gaps, apply Multi-Otsu thresholding, clean up with morphological erosion–dilation–area-opening, binarise, run Canny edge detection, feed the edge map to a probabilistic Hough transform, and curve-fit an A·sin(0.0175·x + phase) + offset model to whatever lines survive. The exact operating point matters, so to be concrete, the edge-and-vote stage ran Canny(200, 255, apertureSize=7) after a medianBlur of kernel size 5, then HoughLinesP with rho=1, theta=pi/180, threshold=30, minLineLength=30, maxLineGap=5.

On a single isolated sinusoid, that works. On a densely fractured section it fails in two compounding ways.

First, Canny has no notion of "which curve." It returns every edge above the gradient threshold — fracture edges, bedding edges, vug rims, tool-band artefacts — as an undifferentiated point cloud. The Hough stage then has to recover global sinusoids from locally-thresholded fragments, and a probabilistic Hough transform votes for straight line segments, not sine waves. You approximate the curve piecewise and hope the votes cluster. In a multi-fracture patch they do not cluster; votes from three different sinusoids smear across the accumulator and the peak you extract belongs to no real fracture.

Second, the thresholds are global and brittle. A single Canny low/high pair and a single Hough vote count have to serve the whole patch. Tighten them and you lose the faint resistive fractures entirely; loosen them and the background noise out-votes the signal. There is no single operating point that resolves three overlapping sinusoids of unequal contrast — which is exactly the regime that matters geologically, because the densely fractured intervals are the ones a reservoir engineer most wants picked.

Path-opening: connectivity as the filter, not contrast

Mathematical morphology offers a different primitive. A path-opening is a morphological filter that keeps only image structures along which you can trace a connected path of a given minimum length, in a constrained set of directions, and removes everything shorter. Instead of asking "is this pixel an edge?" it asks "does this pixel lie on a long, thin, coherent curve?" — which is precisely the property that distinguishes a fracture sinusoid from speckle, vug rims, and short bedding fragments.

The implementation we used builds an upper skeletonisation of the thresholded patch and then constructs weighted adjacency graphs over the skeleton, so that connectivity is evaluated as path-length over a graph rather than as a fixed structuring element. (The unbiased path-opening formulation of Asplund and Hendriks, 2016, is the morphological foundation here — it removes the orientation bias that naive path-openings introduce.) The decisive parameter is the path-length threshold: the minimum connected length a structure must have to survive the opening. Set it low and short noise fragments pass; set it high and only the longest, most coherent curves remain.

And that single knob is what unlocks the multi-sinusoid case.

The 39-threshold sweep

A fracture sinusoid in this carbonate is not one fixed length. A continuous full-range fracture spans the whole patch; a discontinuous broken fracture survives only as shorter conductive segments; a bedding plane is shorter still. No single path-length threshold isolates all of them, for the same reason no single Canny threshold did. The difference is that the path-opening threshold is a clean, monotone control — raising it strictly removes shorter structures — so instead of guessing one value, you sweep the whole range and read the curves out across thresholds.

That is exactly what we did. The path-opening operator was applied across 39 distinct path-length thresholds — sampling the range so that, at threshold 1, almost everything survives, and by threshold 39 only the longest continuous sinusoid remains, with the intermediate values (7, 22, and so on) peeling off structures of decreasing length in between. Each fracture sinusoid in the section emerges cleanly at the threshold that matches its own connected length, then drops out as the threshold climbs past it. The sweep turns one impossible global decision into 39 easy local ones.

SET PREDICTION · HUNGARIAN VS NMS · SCHEMATICALL KEPTevery sinusoid keeps a query5 / 5 sinusoids detectedCrowd the patch — only one engine survives the overlapOne-to-one matching gives each real sinusoid its own query; NMS reads the overlap as a duplicate and deletes it.Hungarian (set prediction)one-to-one · surplus → no-objectNMS (anchor / suppression)overlap read as duplicate → delete8 DECODER QUERIESq1q2q3q4q5q6no-objectq7no-objectq8no-objectUNWRAPPED BOREHOLE PATCH · 5 GROUND-TRUTH SINUSOIDSOverlap densitycrossing← drag to raise overlap · sinusoids crowd and crossreal sinusoid · matched query (teal)deleted real fracture (NMS only)Schematic mechanism — no benchmark numbers. Query, sinusoid count & overlap geometry are illustrative.
Why set prediction survives overlap where suppression fails. Left: a fixed bank of decoder queries. Right: a schematic unwrapped borehole patch carrying overlapping ground-truth sinusoids (fractures and beddings). Drag the slider to raise overlap density and toggle the engine: Hungarian matching re-solves a one-to-one assignment so every real sinusoid keeps its own query (surplus queries route to 'no-object', shown dimmed) — overlap is the signal, nothing is deleted; flip to NMS and rising overlap makes non-maximum suppression read the tightest-overlapping pair as a duplicate and delete a real fracture (the orange trace). This is a structural mechanism illustration — it sources no benchmark numbers; query count, sinusoid count, and overlap geometry are schematic.

On a highly fractured complex section where the Canny–Hough pipeline returned an unusable smear, the 39-threshold path-opening sweep recovered three distinct sinusoids — each appearing at its characteristic threshold band, each separable, each fit independently. The same approach held up on other dense intervals we analysed unsupervised across this operator's fractured carbonate. Three clean fractures out of a patch where the edge detector saw only noise is, for an unsupervised method that has never seen a label, a strong result — and a genuinely useful floor.

Why this matters as engineering, not just as a trick

It is tempting to file path-opening under "classical CV we replaced with deep learning." That misreads what the baseline does in a real pipeline.

It is a near-free oracle. Path-opening needs no labels, no training, and no GPU. A full sweep ran in roughly two minutes per two-metre interval. That makes it cheap enough to run over a whole well and use as a triage and sanity layer: it flags where the fractured sections are, gives a first dip/azimuth estimate by curve-fitting the recovered sinusoids, and — critically — establishes the unsupervised performance floor. If your expensive supervised model cannot beat a parameter-free morphological operator, you have learned something important about your labels before you have spent a quarter on training.

It defines the evaluation contract. The recovered sinusoids were scored the same way the supervised picks later would be: a predicted sinusoid counts as a true positive only if its depth falls within a 2 cm (six-pixel) tolerance of a ground-truth pick. Building that physical-units evaluation harness against the unsupervised baseline meant the metric was already trustworthy and well-understood by the time the Detection Transformer arrived — the supervised model stepped into a measurement frame the baseline had already proven out.

It exposes the data, not just the model. Sweeping thresholds and watching which sinusoids appear and disappear is itself diagnostic. The window-size and overlap experiments around it — windows of 30 with no overlap, 25, 30 with overlap 10, 50 with overlap 15 — were really experiments in how much context the operator needs to resolve adjacent fractures, and that question, answered cheaply on the baseline, directly informed the patch geometry the supervised model used later.

That is the through-line of the engagement's CV stack: the unsupervised morphological baseline and the supervised Detection Transformer are not rivals. The first is the floor and the instrument; the second is the production model that clears it. Path-opening across 39 thresholds is what told us, before we labelled anything, that there were exactly three sinusoids in that section to find.

Key takeaways

  1. A borehole fracture is a sinusoid in unrolled image space — amplitude is dip, phase is azimuth — so detection reduces to finding and fitting sine waves. The hard case is densely fractured carbonate, where several sinusoids of unequal contrast cross within one patch.
  2. A classical Canny–Hough pipeline (Canny 200/255 aperture 7, then HoughLinesP) fails there for two reasons: Canny returns undifferentiated edges with no notion of which curve, and a single global threshold cannot resolve three overlapping sinusoids of different contrast.
  3. Mathematical morphology's path-opening filters by connectivity, not contrast — it keeps only structures lying on a long connected path (upper skeletonisation + weighted adjacency graphs; the unbiased Asplund–Hendriks 2016 formulation). Its path-length threshold is a clean, monotone control.
  4. Sweeping that threshold across 39 values turns one impossible global decision into 39 easy local ones: each fracture emerges at the threshold matching its own connected length. On a complex fractured section this recovered three distinct sinusoids where Canny–Hough returned noise.
  5. The value is engineering leverage, not nostalgia: path-opening needs no labels or GPU (~2 min per 2 m interval), sets the unsupervised performance floor, and lets you stand up the 2 cm depth-tolerance evaluation harness before the supervised Detection Transformer is ever trained.

References

[1] Asplund, T., and Luengo Hendriks, C. L. A faster, unbiased path opening by upper skeletonization and weighted adjacency graphs. IEEE Transactions on Image Processing (2016). The morphological path-opening formulation underpinning the unsupervised fracture baseline.

[2] Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., and Zagoruyko, S. End-to-End Object Detection with Transformers (DETR). ECCV (2020). The supervised set-prediction model whose floor the path-opening baseline establishes. https://arxiv.org/abs/2005.12872

Go to Top

© 2026 Copyright. Earthscan