Detect and extract text from images with Flow Builder

You can use the Analyze Image step in your flows to detect and extract text from images. Being able to extract textual information from images has a variety of useful applications, including identity verification.

Privacy & data protection

If you're extracting sensitive information from an image, such as details from a passport for the purposes of identity verification, you need to make sure that you're following a proper privacy policy.

You are responsible for and must secure all necessary notices, permissions, and consents to collect, use, and share people's content and information, including maintaining a published privacy policy, and otherwise complying with applicable law.

Check out the WhatsApp Business Policy for specific WhatsApp usage guidelines.

How does it work?

In Computer Vision, the process of detecting and extracting text from an image is known as Optical Character Recognition (OCR). Our Analyze Image step makes use of OCR to allow users to extract and post-process textual data detected within images.

Supported document types

The Analyze Image step will automatically detect and extract text from any image. Once detected, the Analyze Image step enables you to do the following:

Parse passport images

Extraction typeInput imageOutput text

Passport

"first_name": "FRED WIREMU JOHN",

"last_surname": "WHAKAATURANGA",

"nationality": "NZL",

"gender": "M",

"date_of_birth": "1964-01-27T00:00:00Z",

"passport_number": "LA001801",

"passport_expiration_date":

"2014-10-06T00:00:00Z"

We extract data from the machine-readable zone (MRZ) of the passports. Since this is standardized internationally, the Analyze Image step should be able to parse all passport nationalities.

Extract raw text

Useful for general text extraction.

Extraction typeInput imageOutput text

Raw text

“Payload”: “US-WSI226941l415”

Image quality best practices

When working with OCR, it’s a good idea to provide your customers with tips on how to upload good quality images that will allow for correct text extraction. If you’ve ever had to sign up for an online banking service and uploaded a photo of your ID, you’ll probably be familiar with some of these guidelines!

  • Document placement: Make sure that the whole document is visible within the image. Don’t cut off any corners.

  • Document orientation: Position the document horizontally. Avoid images that are tilted.

  • Text size: Our text detection works best when the image text is around 30pt (11mm or 40px.) The Analyze Image step will automatically resize the image to match, but this can degrade image quality and lower the detection performance.

  • Glare: Glare can be produced by bright flashes or general background lighting, and it can make it very difficult to extract text from an image! The best images are glare-free.

Using the Analyze Image step

To use the Analyze Image step, just drag and drop the step into your flow! Take a look at some of the example step setups below.

Using the Analyze Image step to detect and extract text from an image of a passport:

Using the Analyze Image step to detect and extract a QR code:

Want to start detecting and extracting text from images? Read our guide to setting up an identity verification flow with Flow Builder, or get started with QR and barcode parsing with computer vision!

Last updated