Processing write-in fields

Aspose.OMR supports several types of fields that allow the respondent to hand write some text or draw a picture. These fields are stored in Images<System.Drawing.Bitmap> collection in recognition results.

Write-in fields

While Aspose.OMR does not support optical character recognition (OCR) at the moment, you can combine it with Aspose.OCR to process fields that contain hand-written text.

Form

?container=Example
?block=Write-in elements
?content=Your name:
	font_style=Bold
?write_in=Full name
	required=true
?content=Your phone number:
	font_style=Bold
?write_in=Phone
	required=true
&block
&container

Filled form

Processing

string appPath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
Aspose.OMR.Api.TemplateProcessor templateProcessor = omrEngine.GetTemplateProcessor("pattern.omr");
Aspose.OMR.Model.RecognitionResult recognitionResult = templateProcessor.Recognize("form-20220519.png");
int i = 1;
foreach(System.Drawing.Bitmap bitmap in recognitionResult.Images)
{
	string writeInPath = Path.Combine(appPath, $"image{i++}.png");
	bitmap.Save(writeInPath);
}

Results

image1.png

Write-in: Full name

image2.png

Write-in: Full name