What Is Ocr Example?

Examples of OCR are text extraction tools, PDF to . txt converters, and Google's image search function. To see OCR software in action, you can try using Text Extractor Tool by Brandfolder. This optical character recognition online tool can convert an image of text (such as a screenshot) into plaintext.

OCR

Article03/03/202213 minutes to read

In this article

Initiate OCR engines to perform OCR related activities

If text on screen (OCR)Wait for text on screen (OCR)Extract text with OCR

Getting started with OCR actions

Power Automate enables users to read, extract, and manage data within an assortment of files through optical character recognition (OCR).

To create an OCR engine and extract text from images and documents with OCR, use the Extract text with OCR action. In the figure below, the engine is created for the purpose of this action alone, and the OCR source is a locally stored image. The action is set to extract text from the entire image. Power Automate supports both Windows OCR engine and Tesseract engine.

The action wherein the OCR engine is created contains the engine settings. These include the language and the image width and height multipliers. The OCR engine variable can be used in any action containing OCR capabilities.

Warning

Image multipliers increase the size of the image to make searching and text extraction more effective. Please note that setting values greater than 3 may lead to erroneous results.

Using the Windows OCR engine

The default engine of all OCR actions in Power Automate is the Windows OCR engine. To extract any text using the Windows OCR engine, you need to install the appropriate languages pack for the language you want to extract.

If the appropriate language pack hasn't been installed, Power Automate will throw an error prompting you to install it. You can find more information regarding downloading and installing language packs in Language packs for Windows.

After installing the appropriate language pack, extend the OCR engine settings of the OCR action and select the desired language. The Windows OCR engine supports 25 languages: Chinese (Simplified and Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian (Cyrillic and Latin), Slovak, Spanish, Swedish, and Turkish.

Using the Tesseract OCR engine

Apart from the Windows OCR engine, Power Automate supports the Tesseract engine. This engine can extract text in five languages without further configuration: English, German, Spanish, French, and Italian.

To extract text in a language outside the mentioned list, enable the Use other languages option in the OCR engine settings of the OCR action. When this option is enabled, the action displays two additional settings: the Language abbreviation and Language data path fields.

The Language abbreviation field indicates to the engine which language to look for during OCR. The Language data path field contains the language data files (.traineddata) used to train the OCR engine. You can find the language data files for all the available languages in this GitHub repository.

The Tesseract engine can be also used to extract text from multilingual documents. You can find more information regarding extracting text from multilingual documents in Perform OCR on multilingual documents.

Note

To make use of the Tesseract OCR engine, make sure the machine's CPU supports AVX2 instruction set.

OCR actions

If text on screen (OCR)

Marks the beginning of a conditional block of actions depending on whether a given text appears on the screen or not, using OCR

Input ParametersArgumentOptionalAcceptsDefault ValueDescriptionIf textN/AExists, Doesn't existExistsSpecifies whether to check if the text exists or not on the given source to analyzeOCR engine typeNoWindows OCR engine, Tesseract engine, OCR engine variableOCR engine variableThe OCR engine type to use. Select a peconfigured OCR engine or set up a new one.OCR engine variableNoOCREngineObjectThe engine to use for the OCR operationText to findNoText valueThe text to search for in the specified sourceIs regular expressionN/ABoolean valueFalseSpecifies whether to use a regular expression to find the specified textSearch for text onN/AEntire screen, Foreground windowEntire screenSpecifies whether to search for the specified text on the entine visible screen or just the foreground windowSearch modeN/AWhole of specified source, Specific subregion only, Subregion relative to imageWhole of specified sourceSpecifies whether to scan the entire screen (or window) or a narrowed down subregion of itImage(s)NoList of ImageThe image(s) specifying the subregion (relative to the top left corner of the image) to scan for the supplied textX1YesNumeric valueThe start X coordinate of the subregion to scan for the supplied textToleranceYesNumeric value10Specifies how much the image(s) searched for can differ from the originally chosen imageY1YesNumeric valueThe start Y coordinate of the subregion to scan for the supplied textX1YesNumeric valueThe start X coordinate of the subregion relative to the specified image to scan for the supplied textX2YesNumeric valueThe end X coordinate of the subregion to scan for the supplied textY1YesNumeric valueThe start Y coordinate of the subregion relative to the specified image to scan for the supplied textY2YesNumeric valueThe end Y coordinate of the subregion to scan for the supplied textX2YesNumeric valueThe end X coordinate of the subregion relative to the specified image to scan for the supplied textY2YesNumeric valueThe end Y coordinate of the subregion relative to the specified image to scan for the supplied textWindows OCR languageN/AChinese (Simplified), Chinese (Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Slovak, Spanish, Swedish, TurkishEnglishThe language of the text that the Windows OCR engine detectsUse other languageN/ABoolean valueFalseSpecifies whether to use a language not given in the 'Tesseract language' fieldTesseract languageN/AEnglish, German, Spanish, French, ItalianEnglishThe language of the text that the Tesseract engine detectsLanguage abbreviationNoText valueThe Tesseract abbreviation of the language to use. For example, if the data is 'eng.traineddata', set this to 'eng'Language data pathNoText valueThe path of the folder that holds the specified language's Tesseract dataImage width multiplierNoNumeric value1The width multiplier of the imageImage height multiplierNoNumeric value1The height multiplier of the imageVariables ProducedArgumentTypeDescriptionLocationOfTextFoundXNumeric valueThe X coordinate of the point where the text appears on the screen. If the search is performed in the foreground window, the coordinate returned is relative to the top left corner of the windowLocationOfTextFoundYNumeric valueThe X coordinate of the point where the text appears on the screen. If the search is performed in the foreground window, the coordinate returned is relative to the top left corner of the window ExceptionsExceptionDescriptionCan't check if text exists in non interactive modeIndicates that it isn't possible to check for the text on the screen when in non-interactive modeInvalid subregion coordinatesIndicates that the specified subregion coordinates are invalidFailed to analyze text with OCRIndicates an error occured while trying to analyze the text using OCRFailed to create the OCR engineIndicates an error occurred while trying to create the OCR engineData path folder doesn't existIndicates that the folder specified for the language data doesn't existThe selected Windows language pack isn't installed on the machineIndicates that the selected Windows language pack hasn't been installed on the machineOCR engine not aliveIndicates that the OCR engine isn't alive

Wait for text on screen (OCR)

Wait until a specific text appears/disappears on the screen, on the foreground window, or relative to an image on the screen or foreground window using OCR

Input ParametersArgumentOptionalAcceptsDefault ValueDescriptionWait for text toN/AAppear, DisappearAppearSpecifies whether to wait for the text to appear or disappearOCR engine typeNoWindows OCR engine, Tesseract engine, OCR engine variableOCR engine variableThe OCR engine type to use. Select a peconfigured OCR engine or set up a new one.OCR engine variableNoOCREngineObjectThe engine to use for the OCR operationText to findNoText valueThe text to search for in the specified sourceIs regular expressionN/ABoolean valueFalseSpecifies whether to use a regular expression to find the specified textSearch for text onN/AEntire screen, Foreground windowEntire screenSpecifies whether to search for the specified text on the entine visible screen or just the foreground windowSearch modeN/AWhole of specified source, Specific subregion only, Subregion relative to imageWhole of specified sourceSpecifies whether to scan the entire screen (or window) or a narrowed down subregion of itImage(s)NoList of ImageThe image(s) specifying the subregion (relative to the top left corner of the image) to scan for the supplied textX1YesNumeric valueThe start X coordinate of the subregion to scan for the supplied textToleranceYesNumeric value10Specifies how much the image(s) searched for can differ from the originally chosen imageY1YesNumeric valueThe start Y coordinate of the subregion to scan for the supplied textX1YesNumeric valueThe start X coordinate of the subregion relative to the specified image to scan for the supplied textX2YesNumeric valueThe end X coordinate of the subregion to scan for the supplied textY1YesNumeric valueThe start Y coordinate of the subregion relative to the specified image to scan for the supplied textY2YesNumeric valueThe end Y coordinate of the subregion to scan for the supplied textX2YesNumeric valueThe end X coordinate of the subregion relative to the specified image to scan for the supplied textY2YesNumeric valueThe end Y coordinate of the subregion relative to the specified image to scan for the supplied textWindows OCR languageN/AChinese (Simplified), Chinese (Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Slovak, Spanish, Swedish, TurkishEnglishThe language of the text that the Windows OCR engine detectsUse other languageN/ABoolean valueFalseSpecifies whether to use a language not given in the 'Tesseract language' fieldTesseract languageN/AEnglish, German, Spanish, French, ItalianEnglishThe language of the text that the Tesseract engine detectsLanguage abbreviationNoText valueThe Tesseract abbreviation of the language to use. For example, if the data is 'eng.traineddata', set this to 'eng'Language data pathNoText valueThe path of the folder that holds the specified language's Tesseract dataImage width multiplierNoNumeric value1The width multiplier of the imageImage height multiplierNoNumeric value1The height multiplier of the imageFail with timeout errorN/ABoolean valueFalseSpecify whether you want the action to wait indefinitely or fail after a set time periodVariables ProducedArgumentTypeDescriptionLocationOfTextFoundXNumeric valueThe X coordinate of the point where the text appears on the screen. If the search is performed in the foreground window, the coordinate returned is relative to the top left corner of the windowLocationOfTextFoundYNumeric valueThe X coordinate of the point where the text appears on the screen. If the search is performed in the foreground window, the coordinate returned is relative to the top left corner of the window ExceptionsExceptionDescriptionCan't check if text exists in non interactive modeIndicates that it isn't possible to check for the text on the screen when in non-interactive modeInvalid subregion coordinatesIndicates that the specified subregion coordinates are invalidFailed to analyze text with OCRIndicates an error occured while trying to analyze the text using OCRFailed to create the OCR engineIndicates an error occurred while trying to create the OCR engineData path folder doesn't existIndicates that the folder specified for the language data doesn't existThe selected Windows language pack isn't installed on the machineIndicates that the selected Windows language pack hasn't been installed on the machineOCR engine not aliveIndicates that the OCR engine isn't aliveTimeout errorIndicates that the action failed after a set time period

Extract text from a given source using the given OCR engine

Input ParametersArgumentOptionalAcceptsDefault ValueDescriptionOCR engineNoWindows OCR engine, Tesseract engine, OCR engine variableOCR engine variableThe OCR engine type to use. Select a preconfigured OCR engine or set up a new one.OCR engine variableNoOCREngineObjectThe engine to use for the OCR operationOCR sourceN/AScreen, Foreground window, Image on diskScreenThe source of the image to perform the OCR operation onImage file pathNoFileThe path of the image to perform the OCR operation onSearch modeN/AWhole of specified source, Specific subregion only, Subregion relative to imageWhole of specified sourceThe selected mode for the OCR operationImageNoList of ImageThe image to use for narrowing down the scan to a subregion that is relative to the specified imageToleranceYesNumeric value10Specifies how much the image can differ from the originally chosen imageX1YesNumeric valueThe start X coordinate of the subregion to narrow down the scanX2YesNumeric valueThe end X coordinate of the subregion to narrow down the scanY1YesNumeric valueThe start Y coordinate of the subregion to narrow down the scanY2YesNumeric valueThe end Y coordinate of the subregion to narrow down the scanWindows OCR languageN/AChinese (Simplified), Chinese (Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Slovak, Spanish, Swedish, TurkishEnglishThe language of the text that the Windows OCR engine detectsUse other languageN/ABoolean valueFalseSpecifies whether to use a language not given in the 'Tesseract language' fieldTesseract languageN/AEnglish, German, Spanish, French, ItalianEnglishThe language of the text that the Tesseract engine detectsLanguage abbreviationNoText valueThe Tesseract abbreviation of the language to use. For example, if the data is 'eng.traineddata', set this to 'eng'Language data pathNoText valueThe path of the folder that holds the specified language's Tesseract dataImage width multiplierNoNumeric value1The width multiplier of the imageImage height multiplierNoNumeric value1The height multiplier of the image

Note

The OCR engine variable option is planned for deprecation.

Variables ProducedArgumentTypeDescriptionOcrTextText valueThe result after the text extractionExceptionDescriptionFailed to extract text with OCRIndicates an error occurred while trying to extract text with OCR from the given sourceImage file not foundIndicates that the file doesn't exist on the given pathLandmark image not foundIndicates that the landmark image doesn't existCan't get text from screen in non-interactive modeIndicates that it isn't possible to get text from screen when in non-interactive modeFailed to create the OCR engineIndicates an error occurred while trying to create the OCR engineData path folder doesn't existIndicates that the folder specified for the language data doesn't existThe selected Windows language pack isn't installed on the machineIndicates that the selected Windows language pack hasn't been installed on the machineOCR engine not aliveIndicates that the OCR engine isn't alive