Skip to content
osmods
ImageJ

Cloudy-plate colony counting

Colony counts that stay honest when the agar is cloudy or the plate is scratched.

View upstream
AuthorKofi Mensah
PublishedAug 2026
LicensePublic domain
Installs27

Why it exists

Counting colonies on clean plates was solved decades ago. Counting them on the plates a teaching lab actually produces, with condensation, scratches and handwriting on the lid, is where automated counts quietly go wrong.

A microbiology TA supplied a semester of worst-case plates. Those photos are the spec: the mod counts them within tolerance or flags the plate for a human. It is not allowed to guess.

What it does

  • Colony detection tolerant of condensation and scratches
  • Flags low-confidence plates instead of guessing
  • Batch reports with per-plate confidence

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.

  • Counts stay within 5% of manual counts on the reference plates
  • Plates below the confidence threshold are flagged, never counted silently

mods/colony-counter/tests/worst_case_plates.py

def test_semester_of_worst_case_plates():
    for plate in reference_plates("teaching-lab"):
        result = count(plate.image)
assert result.flagged or within(result.count, plate.manual, pct=5)