Skip to main content

Crate visual_cortex_vision

Crate visual_cortex_vision 

Source
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.
ColorDominance
Boolean detector/gate: at least min_fraction of pixels are dominated by one channel (e.g. “the HP bar area is mostly red”).
ColorMatch
Boolean detector/gate: at least min_fraction of the region’s pixels are within tolerance (per channel) of the target RGB color.
FnDetector
Adapt a closure into a Detector. See from_fn.
FrameDiff
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 OcrEngine into a Detector.
TemplateMatcher
Grayscale normalized cross-correlation template matcher.
TextSpan
One recognized text region. bbox is relative to the evaluated view.

Enums§

Channel
A primary color channel, for ColorDominance.
DetectorError
DetectorOutput
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-onnx crate; 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))).