Expand description
Detectors: the Detector trait, built-in gates, and the OcrEngine trait.
Modules§
- patterns
- Text parsers for OCR output. Used with
WatcherBuilder::ocr.
Structs§
- Brightness
- Mean luma (0.0..=255.0) of the region, as
DetectorOutput::Number. Pair with.on_threshold(...)for “screen went dark”-style watchers. - Color
Dominance - Boolean detector/gate: at least
min_fractionof pixels are dominated by one channel (e.g. “the HP bar area is mostly red”). - Color
Match - Boolean detector/gate: at least
min_fractionof the region’s pixels are withintolerance(per channel) of the target RGB color. - FnDetector
- Adapt a closure into a
Detector. Seefrom_fn. - Frame
Diff - Boolean gate: did the region’s pixels change since the last evaluation? Hashes the region’s bytes; the first evaluation always reports changed.
- OcrDetector
- Adapts any
OcrEngineinto aDetector. - Template
Matcher - Grayscale normalized cross-correlation template matcher.
- Text
Span - One recognized text region.
bboxis relative to the evaluated view.
Enums§
- Channel
- A primary color channel, for
ColorDominance. - Detector
Error - Detector
Output - What a detector produced this tick.
Traits§
- Detector
- Evaluates one region of one frame. Built-in detectors, gates, and user-defined detectors all implement this same trait.
- OcrEngine
- Pluggable OCR backend. The default ONNX/PaddleOCR implementation lives in
the
visual-cortex-ocr-onnxcrate; any engine can slot in here. Returning an empty vec means “no text present” and is not an error.
Functions§
- from_fn
- Build a detector from a closure:
from_fn(|view| Ok(DetectorOutput::Bool(true))).