hammerspoon2-docs
    Preparing search index...

    Function recognizeText

    • Recognize text in the image at the given file path. Returns a Promise that resolves with an HSOCRResult containing all recognized text and per-region observations. The image must exist on disk; URLs and data buffers are not supported. Recognition is performed on a background thread; the main thread is not blocked during the operation. "accurate" uses a larger neural network for better results; "fast" trades accuracy for speed. Observations whose confidence is below this threshold are excluded from result.observations (and therefore from result.text). Hints Vision toward specific languages. Use supportedLanguages() to enumerate the available codes for the current device. When true, Vision selects recognition languages automatically. Overrides languages when set.

      Parameters

      • path: string

        Absolute path to the image file.

      • options: Record<string, any> | null

        Optional configuration object (see description).

      Returns Promise<HSOCRResult>

      Resolves with the recognition result.