←Select platform

ITemplateForm Interface

Summary

Represents a template form in the LEADTOOLS OMR toolkit. The interface provides methods for reading and writing template form recognition attributes, processing fields, and images.

Syntax
C#
C++/CLI
Java
Python
public interface ITemplateForm : IForm 
public interface ITemplateForm 
    extends IForm 
public: 
   interface class ITemplateForm abstract : IForm 
class ITemplateForm(IForm): 
Remarks

Each OMR form consists of a page or multiple pages of OMR sheets. There are two types of forms: the ITemplateForm and the IRecognitionForm form.

The ITemplateForm object represents the empty OMR sheets. After adding a page to the template form, LEADTOOLS OMR toolkit auto-detects the OMR bubbles in the form and saves the form attributes internally. The LEADTOOLS OMR toolkit facilitates saving and loading these attributes in binary formatted data to or from a standard .NET Stream provided by the user.

After creating the processing fields, call ITemplateForm.ExtractInfo to populate the fields with the detected OMR bubbles within the specified area.

IRecognitionForm objects are used for the filled-in forms that have the same page layout as the ITemplateForm. During recognition and processing, the LEADTOOLS OMR toolkit automatically aligns the IRecognitionForm images with the corresponding ITemplateForm objects and processes the fields provided in the ITemplateForm in the filled-in images.

To create an ITemplateForm object, call the OmrEngine.CreateTemplateForm method.

Note

The following example is a snippet of a larger example project. To run the larger example project, follow the work flow laid out in the OMREngine example. You can also download the complete Visual Studio 2017 project.

Example
C#
using Leadtools.Barcode; 
using Leadtools.Codecs; 
 
using Leadtools.Forms.Processing.Omr; 
using Leadtools.Ocr; 
 
public static void SaveTemplateToDisk(ITemplateForm template) 
{ 
   using (FileStream fs = new FileStream(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\OMR Processing\Exam\exam-example-template.tdd"), FileMode.Create)) 
   { 
      template.Save(fs); 
 
      fs.Close(); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Processing.Omr Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.