# Headless-server patch for OMRChecker

Upstream `src/utils/interaction.py` calls `get_monitors()[0]` at import time and
uses `cv2.imshow()` during processing. That crashes on Linux servers without a
display attached.

This patch:
- Detects headless mode (`OMR_HEADLESS=1`, missing `DISPLAY`, or no monitors)
- Falls back to a safe monitor size
- Skips GUI calls in headless mode

It does **not** change OMR detection, thresholds, or marker alignment.

## Apply manually

If `src/utils/interaction.py` still contains `monitor_window = get_monitors()[0]`,
replace it with the headless-safe version already present in this repository.

## Required environment variable on servers

```bash
export OMR_HEADLESS=1
```

## Required config for production

In your template directory `config.json`:

```json
{
  "outputs": {
    "show_image_level": 0
  }
}
```

Never use `show_image_level` above 0 on a server.
