How To Extract Text From Image Using Cognitive Service And Microsoft Flow

In this article, you will see how to extract text from image 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) connector text will be extracted from the image.

Introduction

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

  1. Navigate to Azure Portal here.
  2. In the left navigation, click Create a resource.
  3. In Azure Marketplace, select AI + Machine Learning and then click Computer Vision.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Enter the required details as shown below and click Create.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. 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.

  2. Click Keys under Resource Management, copy the Key value.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Click Overview and copy the endpoint.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow

Create and test the flow

  1. Navigate to flow site here.
  2. In the top navigation, click My flows.
  3. Click create from the blank.
  4. 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.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Click the next step and search for computer vision as shown below. Select optical character recognition (OCR) to text. 

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Enter the following details and click create.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
    • 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.
  1. Select Image Content for Image Source drop-down. Select the dynamic content file content for image content.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Click Save, once the changes are completed.
  2. Click Test to test the workflow.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Navigate to SharePoint Picture library and upload an image with the text.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. Flow ran successfully as shown below.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow
  1. The detected text will be displayed in the output as shown below.

    How To Extract Text From Image Using Cognitive Service And Microsoft Flow

Summary 

Thus in this article, you saw how to extract text from an image using Cognitive Service and Microsoft Flow.