One value per pixel, row-major, on a 0-255 scale.
Image width in pixels.
Image height in pixels.
Region of interest; clipped to the image.
See LocalMedianOptions.
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".
Count pixels that deviate from their own local median — the narrow-tick detector.
Every pixel of the clipped region whose local median clears
backgroundCutoffis "inside"; each inside pixel is then compared to that median and counted as a dark or bright outlier when it deviates by more thanthreshold. 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) / 2pixels, 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.