In this article, you will see how to extract text from images using Cognitive Service and Microsoft Flow. An image will be uploaded to SharePoint picture library that triggers the flow, and using Computer Vision API (uses the OCR operation to recognize and extract printed text from an image) the connector text will be extracted from the image.
Get Subscription Key
Navigate to Azure Portal here.
In the left navigation, click Create a resource.
In Azure Marketplace, select AI + Machine Learning and then click Computer Vision.
Enter the required details as shown below and click Create.
It might take a few minutes to deploy the resource. Click All Resources in the left navigation and then click the newly created computer vision resource.
Click Keys under Resource Management, copy the Key value.
Click Overview and copy the endpoint.
Create and test the flow
Navigate to flow site here.
In the top navigation, click My flows.
Click create from the blank.
Select When a file is created in a folder, and select the SharePoint site address and picture library folder where the image will be uploaded.
Click the next step and search for computer vision as shown below. Select optical character recognition (OCR) to text.
Enter the following details and click create.
Connection Name – a user-friendly name for the connection.
Account Key – Copied from the above get subscription key section.
Site URL – Copied from the above get subscription key.
Select Image Content for Image Source drop-down. Select the dynamic content file content for image content.
Click Save, once the changes are completed.
Click Test to test the workflow.
Navigate to SharePoint Picture library and upload an image with the text.
Flow ran successfully as shown below.
The detected text will be displayed in the output as shown below.
Thus in this article, you saw how to extract text from an image using Cognitive Service and Microsoft Flow.