Skip to content
osmods
ImageJ

Low-contrast measurement

Leaf area measurement that holds up when the plant barely contrasts with the soil.

View upstream
AuthorMarta Iglesias
PublishedMay 2026
LicensePublic domain
Installs58

Why it exists

A plant biology lab measured thousands of seedlings a season and lost afternoons to the ones ImageJ could not segment: pale leaves on pale substrate. The default threshold either swallowed the tray or dropped half the leaf.

The lab described the failure, supplied thirty of their worst images, and iterated on previews until the measurements matched their manual tracings. That set of images is now the mod's test suite: any future version has to pass the same trays before it ships.

What it does

  • Adaptive segmentation tuned for low figure-ground contrast
  • Falls back to the stock pipeline when contrast is normal
  • Flags measurements below a confidence threshold for review
  • Batch mode keeps per-image provenance in the results table

The spec

These acceptance criteria were written with the person who requested the mod, then locked in as its tests. The mod has to pass them on every new release train before it rides along.

  • Measured leaf area stays within 3% of manual tracing on the lab's reference trays
  • High-contrast images produce identical results to stock ImageJ
  • Images the mod is unsure about are flagged, never silently measured

mods/low-contrast/tests/reference_trays.py

def test_pale_seedlings_match_manual_tracing():
    # 30 worst-case images contributed by the requesting lab
    for tray in reference_trays("pale-on-pale"):
        measured = measure(tray.image, mod="low-contrast")
assert within_tolerance(measured.area, tray.manual_area, pct=3)