LEADTOOLS Support
Document
Document SDK Questions
Using Master Forms to recognize a form return unclear data
#1
Posted
:
Tuesday, March 20, 2018 4:32:55 AM(UTC)
Groups: Registered
Posts: 1
Hi,
i have used the demo program to create a master form template and tested it with the OCR demo program.
Everything works fine.
but, i have created my own program, but the data is inconsistent.
for instance the bar code does not return any data.
here is my code:
Code:
string filename = @"C:\Users\***\MasterFormTest21.tif";
_documentGrid = new gridControl(_confirmationsAdapter, selecteddocumentType)
{
Parent = MainPanel,
Dock = DockStyle.Fill
};
MainPanel.Controls.Add(_documentGrid);
string repositoryPath = @"C:\Users\***\singleForm\";
rasterCodecs = new RasterCodecs();
DiskMasterFormsRepository repository = new DiskMasterFormsRepository(rasterCodecs, repositoryPath);
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false);
ocrEngine.Startup(null, null, null, @"C:\Development\SDK\LEADTOOLS 19\Bin\Common\OcrProfessionalRuntime");
BarcodeEngine barcodeEngine = new BarcodeEngine();
AutoFormsRecognitionManager managers = AutoFormsRecognitionManager.None;
managers |= AutoFormsRecognitionManager.Ocr;
autoEngine = new AutoFormsEngine(repository, ocrEngine, barcodeEngine, managers, 30, 80, true)
{
RecognizeFirstPageOnly = true,
FilledFormType = Leadtools.Forms.FormsPageType.Normal
};
try
{
CodecsImageInfo info = rasterCodecs.GetInformation(filename, true);
for (int page = 1; page <= info.TotalPages; page++)
{
RasterImage image = rasterCodecs.Load(filename, page);
AutoFormsRunResult result = autoEngine.Run(filename, null);
if (result != null)
{
if (result.FormFields != null && result.RecognitionResult.MasterForm != null)
{
foreach (FormPage formPage in result.FormFields)
{
foreach (FormField formField in formPage)
{
if (formField is BarcodeFormField)
{
string barCode = string.Empty;
for (int i = 0; i < ((formField as BarcodeFormField).Result as BarcodeFormFieldResult).BarcodeData.Count; i++)
{
barCode = GetDataString((((formField as BarcodeFormField).Result as BarcodeFormFieldResult).BarcodeData[i].GetData()));
}
Console.WriteLine(barCode);
}
}
}
}
}
}
}
catch (Exception)
{
throw;
}
#2
Posted
:
Wednesday, March 21, 2018 8:30:07 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 63
Thanks: 2 times
Was thanked: 4 time(s) in 4 post(s)
Morne,
It appears that you currently have an ongoing case with our support department regarding this issue. We'll work on this case via email as we need additional information on how to reproduce this.
Joe Zhan
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Document
Document SDK Questions
Using Master Forms to recognize a form return unclear data
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.