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.
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.
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:\LEADTOOLS23\Resources\Images";
}