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.
public interface ITemplateForm : IForm
public interface ITemplateForm
Public Interface ITemplateForm
interface class ITemplateForm abstract : IForm
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.
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 example in Visual Studio 2017.
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))
static class LEAD_VARS
public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";