Product Documentation
Abstract
When recognizing text on a page, it is possible to have the engine detect table layouts as well. When table rows and columns are detected, the results can be used with an action, such as "FindTableValueRegEx", which specifically operates on table results. For an action like this to work well, the engine needs to properly detect the table layout. Detection of tables, as with recognition of text, can have errors. This guide explains requirements for documents to help achieve a higher percentage of accuracy.
Content
1. Requirements for table detection
When the engine performs table identification, table rows and columns may not be detected as expected as compared to how the table looks on the page and how the human eye interprets the image. Recognition engines internally use heuristic algorithms. As is true for text recognition, your application will need to handle situations, where table layouts are not identified correctly.
The following are requirements for table detection:
- All cells must have a rectangular shape.
- Cells must not intersect each other.
- There must not be cells within the cells.
- Cells need to be all on the same horizontal row. That means, along any particular row, there are no cells, whose bottom of the characters are interesting in the middle of characters in a horizontally adjacent cell.
- Some recognition actions, such as OCR/SR, will not detect a table if it does not contain gridlines to define the table.
The following guidelines help the engine recognize a table and the cells within the table:
- Gridlines surrounding the entire table.
- Gridlines that show the cells.
- Cells should be even so that adjacent cells are the same height.
2. Recognition Considerations
Often the image enhancement operation of line removal helps improve recognition of text. It is common that when lines are removed from a page, recognition of text will become more accurate. When attempting to detect a table, line removal should not be used as the lines will help guide the engine to understand the table. This shows that there can be a trade-off when using table detection, where there is a choice between higher accuracy of text recognition versus detection of the table layout.
Image enhancement is always the first tool to use to improve recognition. It is also possible that it could help table detection by removing noise and darkening lines. It is recommended to test with various image enhancement settings to see if it improves table detection.
Some actions provide additional settings that can adjust how tables are recognized. Review the action help to see what settings are available. Testing is required to determine which settings work best for the largest number of documents.
3. Sample Table
The following is a type of table that typically recognizes well.
Item
|
Stock Number |
Price |
Front Right Outer door handle |
1234 |
5.00 |
Front Left Side Outer door handle |
1235 |
5.00 |
Rear Right Side Outer door handle |
1236 |
5.00 |
Rear Left Side Outer door handle |
1237 |
5.00 |
Front Right Side Inner door handle |
1238 |
5.00 |
Front Left Side Inner door handle |
1239 |
5.00 |
Rear Right Side Inner door handle |
1240 |
5.00 |
Rear Left Side Inner door handle |
1241 |
5.00 |
Back Door Outer Door Handles |
1242 |
5.00 |
Front Right Side Window motor |
1243 |
44.99 |
Front Left Side Window motor |
1244 |
44.99 |
Sparking cable |
1245 |
15.95 |
Distributor |
1246 |
8.95 |
Distributor Cap |
1247 |
11.45 |
Electronic timing controller |
1248 |
24.99 |
Ignition box |
1249 |
12.00 |
Ignition coil |
1250 |
10.00 |
Detection is typically better if there is clear area around the table. If there is text close to the table, it may be considered as part of the table.
3.1. Tables Without Gridlines
The OCR/SR engine will not detect tables without gridlines. The OCR-A engine will attempt to recognize a table pattern when the text is arranged in a way that could be considered a table. The success for this kind of detection is significantly less than when gridlines are used, but it may work acceptably depending on the text layout.
If the page does have a table shape, but there are clear areas that are empty cells, then detection will be even less successful. When no gridlines are on the page, it is much easier for a human to understand the intent that a table is intended versus the engine determining that a table exists and the proper table boundaries.
3.2. Table Detection Issues
It is possible for two pages that have the same format to recognize differently, both with and without gridlines. However, the problem of incorrect detection is typically more pervasive when there are no gridlines.
Applications need to handle situations, where table layouts are not detected as expected. It is also important to realize that not all table structures are clear as to how they should be represented. It is possible for designers to have different expectations for the same table. Applications will need to handle these situations. If tables are not detected as expected, it is not considered a defect but might be considered as an enhancement request.
4. Summary
There are infinite possible ways to create tables. A common, straight-forward table that is on a clean page with clear lines is the best way to help achieve consistent detection of a table. If a table is not accurately detected, it is not necessarily a defect, just as a miss-recognized word is not necessarily a defect. It is suggested to try the various methods discussed to see if an acceptable percentage of success can be achieved for a given application.
For successful and repeatable detection, pages should consistently have good clear tables that follow the requirements for good detection. It is recommended that a large number of pages are tested to determine if table detection is reliable enough for use. If it is not reliable enough, then a different approach should be considered. Even when a reliable table is used, there can always be a mistake by the recognition engine. In either case, if detection is not as expected, it is up to the application to handle the issue.
Was this topic helpful?
Document Information
More support for:
IBM Datacap
Software version:
All Versions
Operating system(s):
Windows
Document number:
743835
Modified date:
08 September 2020
UID
ibm10743835