Paper forms are different from invoices. The values sit in fixed places, many answers are tick boxes, people sign in a box, and names are hand printed one letter per box. DocView Capture reads all of these:
- Tick boxes (OMR) turn a group of boxes into one value, for example
Title: Mr / Mrs / Miss / MsorYes / No. - Signature boxes tell you whether a form is signed.
- Zonal OCR with drop-out reads hand printing in comb boxes.
- Registration follows the printed boxes, so slightly shifted scans still read.
- Layout rules recognise which form, and which language version of a form, a document is.
Use this page when you set up a Batch Setup for forms, for example an application form. For general field settings, see Fields and extraction.
When to use tick boxes (OMR)
Use the Tick boxes (OMR) method for any field that people answer by ticking or crossing a printed box:
- a choice of one answer from several, such as a title or a payment method,
- a single "yes" box, such as "Tick if you agree",
- a signature box, where any pen mark counts.
OMR does not need OCR, so it is fast and works the same with every OCR engine.
Add a tick-box field
- Open the Batch Setup, go to Document classes & fields and open the document class. Create a draft first if the version is released.
- Click Add field and fill in the Basics, for example the label "Title" and the data type Text.
- Under Extraction, choose the method Tick boxes (OMR).
- Set the Page, Value when none is ticked, Value when several are ticked, Ticked from (share of dark pixels) and Look for each box within (mm).
- Click Save field.
- Click Open the zone designer and choose the method Tick boxes (OMR).
- Drag around each box on the sample page and type the value it stands for, for example
Mr. - Set the value when none is ticked and when several are ticked, click Test, then Save to field.
The box positions and the advanced settings (boxes, inset, register) are kept in the field's settings. An import from Kofax Capture fills them in for you. Settings the form does not show are kept as they are when you save. The panel Where the value comes from in the field editor shows the boxes on the sample.
You can also read tick boxes with a Tick boxes (OMR) finder, and choose it under Value from finder. See Finders and zones.
Read a whole form with Advanced zones
A form with many fields is easier to set up with one Advanced zones (form) finder than with a zone per field. It works like the Advanced Zone Locator of Kofax Transformation:
- One finder, for example
AZL, holds every zone of the form: text zones, tick-box groups, single tick boxes, signature areas and barcodes. - Each zone is a value. Fields take it under Value from finder as
AZL.<zone>, for exampleAZL.Surname. - Registration boxes line the page up once, before all its zones are read. Line pages up within (mm) sets how far (default 10; 0 switches it off).
- Text zones have the options Hand printing (drop-out), Capitals and Allowed characters. Tick-box zones have Value when marked, Value when empty and Value when several.
The boxes are read in the same way as described below. See Advanced zones (form) for the steps. An import from Kofax Capture creates this finder for you.
To fill a form type field, use a Document type (classification) finder. It gives the document's type as a value.
How OMR reads a group
DocView reads a group of boxes in four steps:
- The page is lined up. If the field lists
registerboxes (other printed boxes on the page), DocView looks for them withinregisterSearchmm. The page only moves when at least two of them, and at least 40 % of them, agree on the same shift within 1 mm. Otherwise nothing moves. - The group's own boxes are found. Each box is looked for within
searchmm of where it should be. The whole group moves together, by the median shift of the boxes found. Zones drawn a little larger than the printed box are fine. - Each box is measured. DocView leaves out the printed border (set by
inset) and measures the inside as solid pen ink. Drop-out colours and stippled printing do not count as ink. - The group decides (see the table below).
How the value is chosen
| What is on the page | Value | Confidence |
|---|---|---|
| One box clearly ticked | That box's value | 0.6 to 1.0 |
| Several boxes marked, but one much darker (at least 1.8 times the next and clearly over the threshold), for example a tick next to a crossed-out box | The darkest box's value | 0.55 |
| Several boxes equally ticked | Value when several are ticked (whenMultiple) |
0.1 |
| Nothing over the threshold, but one faint mark well above the others | That box's value | 0.35 |
| Nothing marked | Value when none is ticked (whenNone) |
0.1 |
A single box gives its value when it is ticked and Value when none is ticked when it is not. For example, a box with the value Y and whenNone set to N gives Y or N.
Low confidence sends the value to an operator. Whether it does depends on the field's Confidence threshold (default 0.8). See Fields and extraction.
Settings reference
Positions are fractions of the page, from 0 to 1: x and y are the top-left corner, w and h the width and height.
{
"page": 2,
"boxes": [
{ "x": 0.29, "y": 0.32, "w": 0.027, "h": 0.023, "value": "N" },
{ "x": 0.36, "y": 0.32, "w": 0.027, "h": 0.023, "value": "Y" }
],
"whenNone": "",
"whenMultiple": "U",
"fillThreshold": 0.08,
"search": 4,
"inset": 0.22,
"register": [ { "x": 0.08, "y": 0.10, "w": 0.03, "h": 0.02 }, { "x": 0.85, "y": 0.90, "w": 0.03, "h": 0.02 } ],
"registerSearch": 10
}
| Setting | On the form | Meaning |
|---|---|---|
page |
Page | The page the boxes are on. 1 is the first page. |
boxes |
– | The boxes of the group, each with its position and the value it gives when ticked (default 1). |
whenNone |
Value when none is ticked | For example empty, N or 0. |
whenMultiple |
Value when several are ticked | For example U for "unclear". The value then has low confidence, so an operator checks it. |
fillThreshold |
Ticked from (share of solid ink) | The share of solid ink inside a box from which it counts as ticked. Without the setting, 0.08 is used. Lower it for light marks; raise it for dirty scans. |
search |
Look for each box within (mm) | How far a box may have moved on the scan. Default 4. 0 measures the zone exactly as drawn. |
inset |
– | The share of the box's smaller side left out at each edge, so the printed border does not count. Default 0.22. |
register |
– | Optional. Other printed boxes of the page, used to line up the whole page first. |
registerSearch |
– | How far, in mm, to look for the register boxes. Default 10. |
anywhere |
A card anywhere on the page, at any angle | For a card or label stuck anywhere on the page. Anchors and boxes are then in millimetres of the card (see below). Off by default. |
dropOut |
Card colour to ignore | With anywhere: the card's printed colour, which never counts as a tick. none (default), red, green or blue. |
inkLevel |
Ink darker than (0–255) | With anywhere: how dark a pen mark must be. Default 150. |
A card anywhere on the page, at any angle
Some tick boxes are not printed on the form itself but on a card or label stuck onto it, wherever there was room and at
any angle. An example is the Royal Mail "We were unable to deliver this item because" card on a returned envelope. Turn
on A card anywhere on the page, at any angle (anywhere) for these:
- Anchors are words printed once on the card, such as
refused,inaccessibleorunknown. DocView looks for them on the whole page. A word found more than once, for example because it was also written by hand, is left out. At least three anchors must be read to place the card. When fewer are read, the finder gives nothing. - Positions are in millimetres of the card, not fractions of the page: the anchors' centres and the boxes' corners, measured on one upright card. The card may be turned to any angle and printed a little larger or smaller.
- Each box is measured turned with the card, in colour at the scan's own resolution.
dropOutignores the card's printed colour (red,greenorblue), so a red card is not counted as a tick.inkLevelsets how dark a pen mark must be, from 0 to 255. The default is 150.
{
"anywhere": true, "dropOut": "red", "fillThreshold": 0.03, "inset": 0.1,
"anchors": [ { "text": "refused", "x": 63.0, "y": 84.0 }, { "text": "unknown", "x": 48.1, "y": 91.4 }, { "text": "inaccessible", "x": 47.1, "y": 87.4 } ],
"boxes": [ { "x": 28.1, "y": 78.0, "w": 2.8, "h": 2.8, "value": "R01" }, { "x": 55.3, "y": 78.7, "w": 2.8, "h": 2.8, "value": "R10" } ]
}
Choosing the value works as for any group: one box clearly ticked gives its value, and several equally ticked give
whenMultiple. Without anywhere, tick boxes are read exactly as before.
Signatures
To find out whether a form is signed, use a single box around the signature area with these settings:
{ "page": 4, "boxes": [ { "x": 0.10, "y": 0.80, "w": 0.45, "h": 0.06, "value": "Y" } ],
"whenNone": "N", "search": 0, "inset": 0.1, "fillThreshold": 0.002 }
search: 0measures the area as drawn, because a signature area has no printed box to look for.inset: 0.1leaves out only a thin edge.fillThreshold: 0.002means any pen ink in the area counts as signed.
The field then reads Y (signed) or N (not signed). DocView does not check whose signature it is.
Registration: shifted and stretched scans
Scanners and fax machines move pages by a few millimetres. DocView copes with that in two ways:
- Each group finds its own boxes within
searchmm. This is enough for most scans. - Registration lines up the whole page first, using
registerboxes: printed boxes spread over the page, such as other tick boxes or comb boxes. Use it when pages are moved further thansearch, for example on fed-in forms.
The page only moves when the register boxes agree: at least two of them, and at least 40 %, must show the same shift within 1 mm. One smudge or a box filled in with ink cannot pull the page the wrong way.
Zonal OCR fields can use registration too (see below). An Advanced zones (form) finder lines the page up once for all its zones, using the registration boxes you draw.
Hand printing in comb boxes
Many forms ask people to write in capitals, one letter per box. Printed comb boxes confuse OCR, because the box sides look like the letters I and l. The Zonal OCR method has extra settings for these zones:
| Setting | Meaning |
|---|---|
dropout |
true keeps only solid pen strokes. It removes light or stippled printing, comb box sides, top and bottom lines and hairlines. |
psm |
How the zone is read: line (the default with drop-out), word, block or auto. |
whitelist |
The characters allowed, for example 0123456789. In digits-only zones DocView corrects common confusions: O → 0, I and l → 1, Z → 2, S → 5, G → 6 and B → 8. |
upper |
true turns the value into capitals. |
comb |
On by default with drop-out. Letters written one per box are joined into one word, and an empty box becomes a space. |
register |
Printed boxes near the zone. The zone follows their shift, found within search mm, with the same agreement rule as above. |
pad |
Millimetres added around the zone, so letters written over the edge are still read. |
For example, a surname in comb boxes:
{ "page": 1, "x": 0.12, "y": 0.25, "w": 0.60, "h": 0.03,
"dropout": true, "psm": "line", "whitelist": "ABCDEFGHIJKLMNOPQRSTUVWXYZ-' ", "upper": true, "pad": 1 }
Important: How well hand printing is read depends on the OCR engine. Tesseract, on your own server, reads clear capitals in boxes, but its accuracy on handwriting is limited. For hand printing in production, use a cloud engine (Azure or Google) for the document class. See OCR engines and languages. Values read with low confidence go to Correction.
Recognise forms by their layout
Forms often look alike in their text, and language versions of the same form have different text but the same purpose. Two classification rule types help:
- pageSize matches the page size, for example a cheque or an A4 page. You can add it on the Document classes & fields tab.
- layout matches the printed tick boxes of a page, or the look of the first pages learnt from sample documents. It tells apart different forms and language versions of the same form. Layout rules come from imports.
See Document classes and classification.
To split a stack of forms, for example 4-page A4 forms with a cheque scanned between them, use the Page size and count separation rule. See Image cleanup and separation.
Tips
- Draw each zone on the printed box. A zone a little larger than the box is fine; DocView finds the box inside it. A zone that misses part of the box reads badly.
- Use
whenMultiplefor "unclear". A value such asUmakes it obvious to the operator and to downstream systems that the answer was not clear. - Check the confidence thresholds. Values chosen from several marks (0.55), faint marks (0.35) and empty or unclear groups (0.1) go to an operator only when they are below the field's Confidence threshold. Keep the default 0.8 unless you are sure.
- Use dictionaries for allowed answers. A dictionary validator or the Translate with a dictionary formatter can check and convert values, for example a title in another language. See Validation rules.
- Test on real scans. Use the Test tab with 10 or more filled-in forms, including poor ones. See Testing a Batch Setup.