Browse our Products
Aspose.OMR for .NET 24.2.0 - Release Notes
What was changed
Key | Summary | Category |
---|---|---|
OMRNET‑953 | Added handwriting recognition plugin. | New feature |
OMRNET‑965 | Added support for handwriting recognition plugin. | Enhancement |
Known issues
Key | Summary | Workaround |
---|---|---|
n/a | If the handwritten character placeholder is left blank, the recognition result returns a random symbol at that position. | Instruct the respondents to fill in all placeholders. |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OMR for .NET 24.2.0 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been added to Aspose.OMR for .NET 24.2.0:
Handwriting recognition plugin
This plugin adds a handwritten input element to machine-readable forms and extends the recognition functionality of Aspose.OMR engine. To access new markup syntax and methods, install Aspose.OMR.Handwriting NuGet package.
You can either add the package to your existing projects, or install the package without downloading the core library. Aspose.OMR for .NET will be installed automatically through a dependency.
Compatibility
- The version 24.2.0 of Aspose.OMR.Handwriting plugin is compatible with Aspose.OMR for .NET version 24.2.0 or later.
- Aspose.OMR.Handwriting plugin requires Microsoft ONNX Runtime version 1.15.1 or later.
text_input
text markup element
Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.
The element is declared with ?text_input=[name]
statement. This statement must be placed on a separate line. name
property is returned in the recognition results; for example, Year,"2024"
. This is an optional property - you can use the same name for multiple text_input
elements or just omit it. The name is not displayed on the form.
text_input
element can be nested within other elements or used at the top level of the form hierarchy.
The text_input
element can be customized by adding attributes to it. An attribute is written as [attribute_name]=[value]
. Each attribute must be placed on a new line immediately after the opening ?text_input= statement
or another attribute, and must begin with a tab character.
Attribute | Required | Description | Usage examples |
---|---|---|---|
length | Yes | The number of character input placeholders. | length=5 |
input_type | No | The type of allowed characters:
| input_type=numbers |
cell_size | No | The size of each placeholder:
| cell_size=large |
text_input
JSON markup element
Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.
The element is declared as an object with "element_type": "text_input"
property:
{
"element_type": "text_input",
"name": "Year",
"length": 4,
}
Required properties
Name | Type | Description |
---|---|---|
length | number | The number of character input placeholders. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
name | string | n/a | Used as a reminder of the element’s purpose and returned in the recognition results; for example, Year,"2024" .You can use the same value for multiple elements. This text is not displayed on the form. |
input_type | string | "numbers" | The type of allowed characters:
|
cell_size | string | "normal" | The size of each placeholder:
|
TextInputConfig
class
Adds a handwritten text placeholder to the form. The placeholder consists of several boxes in which the respondent can write letters or numbers, one character in each box.
Handwritten text placeholder element is declared as an instance of TextInputConfig
class:
var input = new TextInputConfig();
input.Name = "Year";
input.Length = 4;
Required properties
Name | Type | Description |
---|---|---|
Length | int | The number of character input placeholders. |
Optional properties
Name | Type | Default value | Description |
---|---|---|---|
Name | string | n/a | Used as a reminder of the element’s purpose and returned in the recognition results; for example, Year,"2024" .You can use the same value for multiple elements. This text is not displayed on the form. |
InputType | Aspose.OMR.Handwriting.Generation.Config.Enums.InputType | InputType.Numbers | The type of allowed characters:
|
CellSize | Aspose.OMR.Handwriting.Generation.Config.Enums.CellSize | CellSize.Normal | The size of each placeholder:
|
Updated public APIs:
No changes
Removed public APIs:
No changes
Usage examples
See the examples below to learn more about the changes introduced in this release:
Add handwriting placeholder
Application code:
var engine = new OmrEngine();
engine.AddPlugin(new HandwritingPlugin());
var generationResult = omrEngine.GenerateTemplate("source.txt");
if(generationResult.ErrorCode != 0)
{
Console.WriteLine(generationResult.ErrorMessage);
return generationResult.ErrorCode;
}
generationResult.Save("", "OMR-Form");
Form markup:
?text_input=Year
length=4
input_type=numbers
cell_size=large
Recognize handwritten text
Application code:
var engine = new OmrEngine();
engine.AddPlugin(new HandwritingPlugin());
var templateProcessor = engine.GetTemplateProcessor("pattern.omr");
var recognitionResult = templateProcessor.Recognize("filled-form.png");
string result = recognitionResult.GetCsv();
Recognition result:
Element Name,Value,
Year,"1989"