All notes
Leadtools

Good links

Settings

Preprocessing

Despeckle

leadtools v19 doc: professional engine settings.

Recognition.PreProcessing.EnableDespeckleMode 	Boolean 	N/A 	
    true to enable image despeckling mode; otherwise, false. The default value is true.

Image despeckling is an adaptive noise removal algorithm used on black and white images having a resolution of 280 DPI or higher. This setting can influence the recognition accuracy.

CharacterFilter

leadToolsSupport: HOW TO: Set Character Filters in OCR Professional Engine.

Alpha = Uppercase | Lowercase
Punctuation: include "!"
Miscellaneous: include "+"
Plus: Enables the use of the "FilterPlus" characters. The FilterPlus characters are added after any filtering.
Numbers = Digit | Plus
All = Digit | Uppercase | Lowercase | Punctuation | Miscellaneous

leadtools.topics.forms.ocr. You can find "CharacterFilter" here.

Auto Zoning

Confidence Reporting

leadToolsV18Help.

It is required to cast the IOcrZoneCharacters to OcrZoneCharacters to uncover the LeadTools char confidence.


public int Confidence {get; set;}
public bool WordIsCertain {get; set;}
// The confidence number expressing the certainty of number of leading spaces in front of this character:
public int LeadingSpacesConfidence {get; set;}

Both Confidence values range between 0 and 100. A value of 64 is recommended for this purpose: A value less than 64 will indicate that the character was recognized with high confidence. A value of 64 or greater marks that code is suspicious.

In some cases a word may have some or all characters that are individually suspicious (low Conficence value) but the characters are not be marked suspicious in OcrCharacter.WordIsCertain. This is usually a result of language or user dictionary checking. It means the word was validated by the checking subsystem.

The confidence reporting system works best when all three recognition modules are used in the voting scheme (OcrZoneRecognitionModule.OmniFontPlus3WayVoting).



private string recognizeWithModule(Bitmap bmp, IOcrDocument document, OcrZoneRecognitionModule module)
{
   var zone = new OcrZone();
   zone.RecognitionModule = module;
   //zone.ZoneType = OcrZoneType.Table;
   zone.Bounds = new LogicalRectangle(0, 0, bmp.Width, bmp.Height, LogicalUnit.Pixel);

   var page = document.Pages[0];
   page.Zones.Clear();
   page.Zones.Add(zone);
   var res = page.RecognizeText(null);
   var a = page.DetectFillMethod(); // OmniFont
   Console.Write(a.ToString());

   var e = (OcrZoneCharacters)(page.GetRecognizedCharacters().FindZoneCharacters(0));
   using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"d:\wcf222.txt", true))
   {
       foreach (var ch in e)
       {
           file.WriteLine(ch.Code);
           file.WriteLine(ch.GuessCode2);
           file.WriteLine(ch.GuessCode3);
           file.WriteLine(ch.Confidence.ToString());
           //Console.WriteLine(ch.WordIsCertain.ToString());
           file.WriteLine(ch.LeadingSpacesConfidence.ToString());
           file.WriteLine();
       }
   }
}

GuessCode

leadToolsHelp.


public char Code {get; set;}
public char GuessCode2 {get; set;}
public char GuessCode3 {get; set;}

The following properties are not supported in the LEADTOOLS OCR Professional and Advantage Engines:

GuessCode2
GuessCode3
LeadingSpaces
LeadingSpacesConfidence