Measured segment uncertainty

What a line segment's own fit statistics say about how well it was located — measured on a real frame, and what consuming them is worth downstream.

The idea. A segment fitted by total least squares already carries the statistics that say how well it was fitted — the number of contributing samples N and the two eigenvalues λmax ≥ λmin of their covariance. So I = N·λmax/λmin estimates the directional information the segment carries, and w = √I is a per-segment weight with no tuning parameters. Most detectors compute something like those numbers and then throw them away.

1. The measurement, one segment at a time

Below is one real frame with the segments a detector found on it. Click any highlighted segment to see what the measurement does to it: a cross-section every pixel along its dominant axis, a search along the normal for the gradient ridge, a parabola through the peak, and the scatter of the accepted ridge points — which is λmin.

frame

Segment brightness is its weight under the selected rule. clickable too short to be worth walking selected

Does the weight say anything length did not?

What the two sources say about this segment

Click a segment on the left.

One cross-section

section

Gradient magnitude at nine samples across the normal, on a 0.5 px grid, with the parabola-refined sub-pixel ridge.

The accepted ridge points

Segment-local coordinates, lateral axis blown up. Their lateral spread is λmin, and the weight follows from it.

Why not just take the detector's own support pixels? They are right there, and using them costs no image pass. Switch the table above to own support and the numbers change — a support region is shaped by the acceptance rule that drew it, so its lateral spread records that rule rather than the noise on where the line is. Section 2 prices the difference.

2. What consuming it is worth

The same detector, the same 1976 frames of one EuRoC sequence, the same estimator — the only thing that changes is the per-segment weight. Error is the angle between the estimated gravity direction and the rig's ground truth.

Per-frame error, running median over 51 frames

The negative result is the memorable one. Weighting by the moments of the detector's own support pixels is worse than not weighting at all — it lands above unit votes. Having the three numbers is not the same as having a measurement of where the ridge is.

3. Where it stops

A precision weight is a statement about how well each member of a set is measured. It presumes the set is the right set. Where the estimator's inlier band is heavily contaminated, precision is not what limits it, and the weight buys nothing.

regimeaxis-consistent fraction of the band what the weight is worth
EuRoC machine hall0.79–0.82 9.4 to 15.1% better, every held-out cell
TUM-VI0.74–0.81improves and degrades in equal measure
EuRoC Vicon rooms0.50–0.58essentially inert
single-image Manhattan triads0.39–0.65 beats unit votes, only ties with length
This is an association measured after the fact over 64 held-out cells, not a test a consumer can run on its own data: it needs a ground-truth axis, and both of our attempts to replace that with the estimator's own axis failed. A reader deciding whether to adopt the weight on a new corpus will have to do what we did, which is try it.

Using it

SweepLSD supplies the three statistics natively — it accumulates the moments inside its streaming labeller, so they cost no extra image pass. LineUQ is the other half: it re-measures the same statistics for detectors that do not supply them, from the image and the reported endpoints alone, and consumes them in a weighted vanishing-point / Manhattan fit.

import lineuq
st = lineuq.measure(image, segments)   # any detector's endpoints
w  = st.sqrt_fisher()                  # the weight used above