ImageGear for .NET User Guide > Using ImageGear for .NET > Using ImageGear.Recognition Namespace > Recognition > Defining the Character Set > Language Selection, LanguagesPlus Characters, and Local Filter |
This example demonstrates reading a printed page in Hungarian, in which a Croatian town name appears repeatedly, containing the character "z-hacek" in lower and uppercase. The Windows Eastern Europe Code Page (1250), is needed as the current Code Page (and for export). The page includes a table containing numbers, which should be zoned separately for digits-only recognition.
In this example the Language environment is formed from the language selection (Hungarian) plus the two additional LanguagesPlus characters "z-hacek" and "Z-hacek". There is no global filter, but there is a local one, DIGIT, defined for one zone.
C# |
Copy Code |
---|---|
igRecognition.Recognition.LanguageEnabled.DisableAll(); igRecognition.Recognition.LanguageEnabled[ImGearRecLanguage.HUN] = true; igRecognition.OutputManager.CodePage = "Windows Eastern"; // Code Page 1250 string s = ""; s += igRecognition.OutputManager.ConvertCodePageToUnicode(0x9E); // z-hacek in CP1250 s += igRecognition.OutputManager.ConvertCodePageToUnicode(0x8E); // Z-hacek in CP1250 igRecognition.Recognition.LanguagesPlus = s; // . . . // 1st zone contains a table with digits ImGearRecZone igRecZone = new ImGearRecZone(); igRecZone.Rect.Left = 970; igRecZone.Rect.Right = 2260; igRecZone.Rect.Top = 1355; igRecZone.Rect.Bottom = 1729; igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT; igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR; igRecZone.Filter = ImGearRecFilter.DIGIT; igRecZone.Type = ImGearRecZoneType.TABLE; igRecPage.Zones.Add(igRecZone); // 2nd zone contains flowed text without filtering igRecZone = new ImGearRecZone(); igRecZone.Rect.Left = 342; igRecZone.Rect.Right = 867; igRecZone.Rect.Top = 665; igRecZone.Rect.Bottom = 1644; igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT; igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR; igRecZone.Filter = ImGearRecFilter.ALL; igRecZone.Type = ImGearRecZoneType.FLOW; igRecPage.Zones.Add(igRecZone); |
VB .NET |
Copy Code |
---|---|
igRecognition.Recognition.LanguageEnabled.DisableAll() igRecognition.Recognition.LanguageEnabled(ImGearRecLanguage.HUN) = True igRecognition.OutputManager.CodePage = "Windows Eastern" ' Code Page 1250 Dim s As String = "" s += igRecognition.OutputManager.ConvertCodePageToUnicode(&H9E) ' z-hacek in CP1250 s += igRecognition.OutputManager.ConvertCodePageToUnicode(&H8E) ' Z-hacek in CP1250 igRecognition.Recognition.LanguagesPlus = s ' . . . ' 1st zone contains a table with digits Dim igRecZone As New ImGearRecZone() igRecZone.Rect.Left = 970 igRecZone.Rect.Right = 2260 igRecZone.Rect.Top = 1355 igRecZone.Rect.Bottom = 1729 igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR igRecZone.Filter = ImGearRecFilter.DIGIT igRecZone.Type = ImGearRecZoneType.TABLE igRecPage.Zones.Add(igRecZone) ' 2nd zone contains flowed text without filtering igRecZone = New ImGearRecZone() igRecZone.Rect.Left = 342 igRecZone.Rect.Right = 867 igRecZone.Rect.Top = 665 igRecZone.Rect.Bottom = 1644 igRecZone.FillingMethod = ImGearRecFillingMethod.OMNIFONT igRecZone.RecognitionModule = ImGearRecRecognitionModule.OMNIFONT_MOR igRecZone.Filter = ImGearRecFilter.ALL igRecZone.Type = ImGearRecZoneType.FLOW igRecPage.Zones.Add(igRecZone) |