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.
The optional options object may contain:
recognitionLevel ("accurate" | "fast", default "accurate"):
"accurate" uses a larger neural network for better results;
"fast" trades accuracy for speed.
minimumConfidence (number 0–1, default 0):
Observations whose confidence is below this threshold are excluded
from result.observations (and therefore from result.text).
languages (array of BCP-47 strings, e.g. ["en-US", "fr-FR"]):
Hints Vision toward specific languages. Use supportedLanguages() to
enumerate the available codes for the current device.
automaticallyDetectsLanguage (boolean, default false):
When true, Vision selects recognition languages automatically.
Overrides languages when set.
Recognize text in the image at the given file path.
Returns a Promise that resolves with an
HSOCRResultcontaining 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.
The optional
optionsobject may contain:recognitionLevel("accurate"|"fast", default"accurate"):"accurate"uses a larger neural network for better results;"fast"trades accuracy for speed.minimumConfidence(number 0–1, default0): Observations whoseconfidenceis below this threshold are excluded fromresult.observations(and therefore fromresult.text).languages(array of BCP-47 strings, e.g.["en-US", "fr-FR"]): Hints Vision toward specific languages. UsesupportedLanguages()to enumerate the available codes for the current device.automaticallyDetectsLanguage(boolean, defaultfalse): Whentrue, Vision selects recognition languages automatically. Overrideslanguageswhen set.