Set up a form with a master image

This step-by-step tutorial will demonstrate how FormX can take care of the data extraction process from documents that share a format

Prerequisites

Objective

Obtain the following information from the business registration forms: {name of business}, {branch name}, {expiry date}.

Creating a Form

Navigate to the form listing page of FormX and click the "Add New Form" button on the top right corner.

You will be prompted with a Create Form modal. Name this form "business registration form" and upload the br_master_image.jpg from the downloaded sample BR forms. Then click "Create":

A new form will be created. Click on the "business registration form" new form.

You will be redirected to the form editor page. Now, you can start setting it up, so that FormX can extract data from the other BR forms based on this form.

Set up the form

Now, we'll first go through a few concepts before marking areas on the master image.

Anchors

An Anchor is a labeled area that serves as a positional reference point, allowing FormX to warp uploaded images of a form. Since uploaded images are more or less different (e.g. a tilted angle) from the master image, FormX will have to twist them by matching their Anchors to the master form's ones before extracting.

For every form with a master image, a user has to mark at least two Anchors, with the longest distance possible between them. When they are further part, more of the form resides between them, which will improve extraction accuracy since the warping process becomes more consistent.

TL;DR: Like an actual anchor, drop one on your master form to prevent future uploaded forms from moving away. At least two are required for FormX to function properly.

An example image is shown below, where two parts on a Business Registration form are marked as Anchors - the "ORIGINAL" one and the title. We will go through anchor-marking in a later paragraph.

You may be wondering: which parts in the master form should I mark with an Anchor? Identify the common parts of your form, then include them with an Anchor. Bear in mind that parts which vary across different documents of the same form should not be anchors.

Adding some to the master image

In the example, we'll mark three anchors which are the common parts of a BR form. Other areas like the actual name of business (i.e. KXX DXX TRANSPORTATION COMPANY) are different on every BR instance, so they don't make good anchors.

Choose the second tool as shown in the image below to mark an Anchor.

Then mark points where the last connects with the first to create an Anchor, as shown in the GIF below.

Note that only three Anchors are marked here, while there exist other common parts that make good Anchors in a BR form, such as the field names "Name of Business/Corporation", "Business/Branch Name" and "Address". Don't confuse them with the field values though, as the field names don't change across BR forms while the values do.

The master form now has enough Anchors to warp properly.

Detection Regions

Detection Regions are the areas that are marked from which you need data extracted. One Detection Region can have several extraction fields, as one region can contain several items of data that are worth obtaining or extracting.

TL;DR: Mark the area where you want information extracted from on the master form with Detection Region.

Adding Detection Regions

In this example, we'll extract name of business, branch name and expiry date from BR forms. To do so, they will be marked with Detection Regions.

Choose the third tool marked with a red box in the screenshot below:

As shown below, we'll add three Detection Regions, each containing a field called "name of business", "branch name", and "expiry date".

Click the "Save" button. Now you've finished setting up this form!

Test it out with other BR forms

There are two more BR forms in the ZIP file you've downloaded at the start of this tutorial. They will be fed to our freshly created form to have the target data extracted.

Navigate to the "Test" tab and choose br_2_mobile_taken. This will trigger an extraction which will complete in no time. Repeat these steps with the other image and you will get similar results.

As shown in the gif above, br_2_mobile_taken originally has a tilted angle but it's corrected and aligned once it's uploaded and warped. It was taken with a mobile phone with a not-so-perfect angle, still FormX manages to enhance such images "lesser" in quality and returns satisfactory results.

Integrating FormX with any app

By calling our APIs, extraction results can be obtained using any app. Navigate to the "API" tab, then copy both the form ID and your access token by clicking the buttons on the top right corner.

Try calling the API with curl. Copy our curl example, replace the corresponding placeholders then press enter! With the correct payload given, you will promptly get the results. Simply translate this curl command to whatever language your app is built with, and you'll have got FormX easily integrated.

If you'd like to learn more about the APIs, we have a complete documentation in the "API" tab.

Done!

You've now successfully extracted information from a set of documents that share the same format! One more tutorial to go!