Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function measureLocalMedianOutliers

    • Count pixels that deviate from their own local median — the narrow-tick detector.

      Every pixel of the clipped region whose local median clears backgroundCutoff is "inside"; each inside pixel is then compared to that median and counted as a dark or bright outlier when it deviates by more than threshold. This is the metric that sees the #790 outer-side miter wedge (a one-to-two-pixel dark tick crossing an otherwise uniform tube), and the metric that is deliberately blind to any smooth variation — see measureAxialFlux for that half.

      It is ALSO blind to any defect wider than about (window + 1) / 2 pixels, which makes the returned fractions a detector rather than a severity measure and makes them incomparable across bands of different turn angle. Read the "Sensitivity envelope" section of the module header before interpreting a number from this function.

      Parameters

      Returns LocalMedianOutlierResult

      Counts, fractions and worst deviations. insidePixels is 0 for an empty, out-of-image or all-background region — assert on it rather than reading a zero outlier count as "clean".

      If the image size is invalid, the buffer is too short, window is not an odd integer >= 3, or a threshold/cutoff is negative.