User Guide > How to Work with... > OCR > How to... > Work with Zones > Detect Tables without Visible Cell Separators |
Tables with visible grid lines (gridded tables) in an original page can usually be detected successfully by the auto-zoning method. However, tables without visible cell separators in the original are harder to identify as tables, because they could alternately be word lists or data arranged in columns. The recognition engine offers an algorithm for detecting such non-gridded tables more confidently. This feature can only be used in conjunction with an auto-zoning step. The algorithm to detect non-gridded tables is based on the result of character recognition. This algorithm will run only if all the following conditions are met:
This section provides information about how to...
The following example contains uppercase letters only for multi-lingual omnifont recognition:
C# |
Copy Code |
---|---|
ImGearRecZone igRecZone = new ImGearRecZone(); igRecZone.Rect.Left = 739; igRecZone.Rect.Top = 63; igRecZone.Rect.Right = 1729; igRecZone.Rect.Bottom = 114; // textual zone: it contains flowed text igRecZone.Type = ImGearRecZoneType.FLOW; // Omnifont filling method was used to fill the zone's area igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT; // MOR recognition module will be applied for the zone's area igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR; // Character Set: only uppercase letters igRecZone.Filter = ImGearRecFilter.UPPERCASE; // Add the zone to the zone list igRecPage.Zones.Add(igRecZone); igRecPage.Zones.SaveToFile("SAMPLE.ZON"); MessageBox.Show("Number of Zones: " + igRecPage.Zones.Count); |
VB.NET |
Copy Code |
---|---|
Dim igRecZone As New ImGearRecZone() igRecZone.Rect.Left = 739 igRecZone.Rect.Top = 63 igRecZone.Rect.Right = 1729 igRecZone.Rect.Bottom = 114 ' textual zone: it contains flowed text igRecZone.Type = ImGearRecZoneType.FLOW ' Omnifont filling method was used to fill the zone's area igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT ' MOR recognition module will be applied for the zone's area igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR ' Character Set: only uppercase letters igRecZone.Filter = ImGearRecFilter.UPPERCASE ' Add the zone to the zone list igRecPage.Zones.Add(igRecZone) igRecPage.Zones.SaveToFile("SAMPLE.ZON") MessageBox.Show("Number of Zones: " + igRecPage.Zones.Count.ToString()) |
To get information about any particular zone of the zone list of the image, the application can access the zone list via the Zones Property of ImGearRecPage Class. This can be useful in finding out more about the zones created by the auto-zoning method.
When updating a table-type zone by accessing the zone list via the Zones Property, the "cell-detection" algorithm won't be activated, which will result in improper table detection within the zone. |
The program can detect cells within a table-zone if automatic page decomposition is used.
C# |
Copy Code |
---|---|
igRecPage.Zones.LoadFromFile("SAMPLE.ZON"); int nZones = igRecPage.Zones.Count; // Get the first zone in the zone list ImGearRecZone igRecZone = igRecPage.Zones[0]; // . . . // Adjust the left border of the zone by 50 pixels igRecZone.Rect.Left -= 50; // Zone content will be handled as a flow text igRecZone.Type = ImGearRecZoneType.FLOW; igRecPage.Zones.SaveToFile("SAMPLE.ZON"); |
VB.NET |
Copy Code |
---|---|
igRecPage.Zones.LoadFromFile("SAMPLE.ZON") Dim nZones As Integer = igRecPage.Zones.Count ' Get the first zone in the zone list Dim igRecZone As ImGearRecZone = igRecPage.Zones(0) ' . . . ' Adjust the left border of the zone by 50 pixels igRecZone.Rect.Left -= 50 ' Zone content will be handled as a flow text igRecZone.Type = ImGearRecZoneType.FLOW igRecPage.Zones.SaveToFile("SAMPLE.ZON") |