OCR Field Type

 

The OCR (Optical Character Recognition) Field type lets you convert written or printed information into text via your device's camera.

 

This premium feature allows a user to capture or upload an image and rapidly convert any text found in the image into raw text or JSON response.

 

CONTENTS

  • Setting up an OCR Field
  • Result Examples
    • Raw Text
    • Raw JSON

 

Note, the OCR field requires an internet connection to return image text.

Setting up an OCR Field

After creating a new Form screen, you will be taken to the Form Designer screen. The Form Designer screen provides a visual view of your Form and a drag-and-drop approach for creating your Form design. 

Along the left section of the Designer, you will find a column of Basic and Advanced Field types.

 

The OCR Field can be found under our Advanced Field types.

 

 

 

Unique properties specific to the OCR field are:

 

 

Result Mode

  • Raw Text
    When this option is chosen, the raw text result will be displayed (extracted from the image).
  • JSON
    When this option is chosen, the complete OCR JSON response will be available in other fields via the JSONVAL() formula.

    For more information on JSON formula, please review Formula Cheat Sheet - Data Interchange.

On Capture Action

  • Define an action each time a successful OCR result is returned.

 

When extracting specific information out of a JSON result , https://jsonpathfinder.com/ might be of assistance.

Result Examples

 

Raw Text

Image uploaded from device gallery.


Raw JSON

Image uploaded from device gallery.

 

The above image depicts RAW JSON Results (Text field) with its dynamic value property driven from the OCR Field - JSON Mode's (OCR field) dataname.

 

Form Designer Build:

 

The JSON result can be processed using JSON Path Syntax.

 

JSON Result (full)

{
    "version": "3.2.0",
    "modelVersion": "2021-04-12",
    "readResults": [
        {
            "page": 1,
            "angle": 12.5894,
            "width": 800,
            "height": 449,
            "unit": "pixel",
            "lines": [
                {
                    "boundingBox": [
                        91,
                        0,
                        788,
                        137,
                        781,
                        174,
                        84,
                        35
                    ],
                    "text": "Nutrition Facts Amount Per Serving",
                    "appearance": {
                        "style": {
                            "name": "other",
                            "confidence": 0.878
                        }
                    },
                    "words": [
                        {
                            "boundingBox": [
                                90,
                                0,
                                281,
                                34,
                                274,
                                70,
                                84,
                                36
                            ],
                            "text": "Nutrition",
                            "confidence": 0.994
                        },
                        {
                            "boundingBox": [
                                300,
                                38,
                                429,
                                64,
                                422,
                                98,
                                293,
                                73
                            ],
                            "text": "Facts",
                            "confidence": 0.995
                        },
                        {
                            "boundingBox": [
                                460,
                                70,
                                585,
                                98,
                                577,
                                130,
                                453,
                                104
                            ],
                            "text": "Amount",
                            "confidence": 0.996
                        },
                        {
                            "boundingBox": [
                                592,
                                99,
                                650,
                                113,
                                643,
                                144,
                                584,
                                131
                            ],
                            "text": "Per",
                            "confidence": 0.997
                        },
                        {
                            "boundingBox": [
                                657,
                                115,
                                783,
                                145,
                                775,
                                173,
                                650,
                                145
                            ],
                            "text": "Serving",
                            "confidence": 0.996
                        }
                    ]
                }
            ]
        }
    ]
}
HTML


JSON Result (retrieve all words text)

 

Syntax:

$.readResults[0].lines[*].words[*].text

[
  "Nutrition",
  "Facts",
  "Amount",
  "Per",
  "Serving"
]
HTML

However, in a Text field's dynamic value, the above syntax would need to be used in junction with our JSON() function.

 

Formula:

SUBSTITUTE(STRING(JSONLIST({{myOCRfieldJSON }}, 'readResults[0].lines[*].words[*].text')) , '|' , '\n')

  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

Date/Time Field Type

When needing to capture temporal data, use our Date/Time field.As the name implies, this Form...

Gallery Field Type

  This is an advanced field type that allows a user to upload multiple images into a form...

NFC Field Type

The NFC field type allows you to build Form screens that can read and write NFC tags using...

Sketch Field Type

  A Sketch Field Type can be used to capture signatures and can also be used to annotate...

Contactless Signature

  Our Signature field allows for the capturing of signatures on a device in one of...