Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Friday, August 2, 2019 4:00:15 PM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 163

Was thanked: 9 time(s) in 9 post(s)

Basic Information
This post is an overview and guide for using the OMR Processing Demo example included in the LEADTOOLS installation folder. For information about the OMR toolkit itself or for example code, please see our documentation and other example posts.

The OMR Processing Demo is a new demo which leverages the OMR processing toolkit available in the most recent version of the LEADTOOLS SDK. This can be found on our downloads page.

Once updated, the OMR Processing Demo can be found in the installation folder.
C:\LEADTOOLS 22\Examples\OCR\DotNet\OmrProcessingDemo

The project within can be launched and ran within Visual Studio.


The Welcome Window displays basic information about the program and its various components.

The Task dialogue shows what options are available for launching the program: a new template can be constructed, an existing template can be loaded, or an existing workspace can be loaded. These will be covered in depth farther down.

Creating and Editing a Template
This section details the Template Editor.

The OMR toolkit functions by using a template created from a default image. The Template Editor section facilitates template construction. To create a new template choose File -> New. The Create New Template dialogue can be used to choose a file on disk.

This demo will use "LEADTOOLS Images\Forms\OMR Processing\Exam\exam.tif". Selecting OK sets the selected document in the viewer. The buttons in the toolbar can be used to navigate individual pages, change the zoom level, and draw new regions. Of particular interest for template construction is drawing new regions, as shown.

  • OMR Region - Changes mode to draw a region which contains OMR marks.
  • Barcode Region - Changes mode to draw a region which contains a single barcode.
  • OCR Region - Changes mode to draw a region which contains text for Optical Character Recognition.
  • Image Region - Changes mode to draw a region which contains information of interest. No actual recognition or processing is performed on Image regions.

Once a region selection mode has been made, a zone of that type can be drawn via drag-and-and-drop.

The Options window is automatically displayed so the zone properties can be finalized. Clicking Cancel will discard the current zone and OK will save it.

The options can be set are whether the region should be treated as a collection of Rows or a collection of Columns. For this region 15 rows and 4 columns have been detected.

The next section is the Grid Options. The Right to Left checkbox affects the ordering of the output data.
The Values box contains pregenerated ranges of values which are applicable to the current selection of either rows or columnns: selecting rows produces valid ranges containing four values (15 rows of four OMR marks), while selecting columns produces valid ranges containing fifteen values (4 columns of fifteen OMR marks). Double-clicking any of these value ranges will expand the range to show all values it contains.

The Create Custom Range... option can be used to enter a range of values if none of the pregenerated ones are applicable. For example, a custom range of 3, 4, 5, 6 can be entered.

There are two different output styles: comma-separated and combined.
In the above image, selecting Comma-Separated means the toolkit will treat each row as discrete and return an individual value for it. For this region, this would result in "A, C, C, D, B".
In the above image, selecting Combined means the toolkit will treat the entire region as the sum of its parts and as such, the result would be "JAMES".

The Grading Options section indicates whether statistical information should be generated for this region and how it should be weighted when checking against a key. These values can be weighted to awared correct responses and penalize incorrect or missing responses.

The "Sensitivity" tab changes the threshold at which the engine determines whether an OMR mark is filled in or not. It is generally not necessary to modify this value.

Clicking "OK" in the OMR Field Dialog confirms the new zone and appends it to the zone structure tree in the UI.

Note the OMR Field Options dialogue is context-sensitive. If any text is detected such as identifying labels, these are detected and set as the value for that OMR mark without needing to specify a range. The values can be modified via the drop-down box with the section of the document the label was extracted from shown for reference.

The Template Tree

The tree structure hierarchy has the template at the top level, then each page in the template, then each region in that page. For OMR regions, the subregions (such as rows or columns) are also available. For bubbles with labels as covered above, these are also attached to the row or column that owns them.

The template tree shows the completed template for the document. This template file is available at "LEADTOOLS Images\Forms\OMR Processing\Exam\exam.ltt".

A node can be modified by highlighting the node and choosing Ctrl+E, or double-clicking the node, or right-clicking and selecting "Edit Node" from the context menu. This action is context-based on the type of node being accessed.

Template options allow an identifier field to be designated. The identifier adds additional context to a processed worksheet. See the corresponding section farther down under Review Results for additional information.

The Page Edit dialogue allows the default name for each page to be changed.

The Region edit is based off the top of region--OMR, Barcode, OCR, or Image. Editing an OMR region launches the OMR Field Options populated with that region's properties, as detailed above.

The smaller areas of each region can also be modified. Note while an individual area can have its grade values modified, it can only have grading enabled or disabled through the OMR Field Options for the OMR region that owns it. Note the "Notes" is optional and can be used for other information. If a value is detected next to an OMR region (such as rows numbered 1, 2, 3...) this value is used as the default.

When right-clicking a node representing an OMR region, the context menu contains both Rename to Note and Renumber Items... to automate renaming. The former automatically changes the value of each row or column to what is stored in its Note property, while the latter launches a dialogue in which a template and starting value are to be specified. Use the % character as a placeholder for the numeric value.

Processing Worksheets
This section detials how to specify worksheets to process and other parameters. Note a template must exist in the Template Editor section for Process Worksheets to be accessed.

After a template has been loaded or constructed, filled-in sheets can be processed using it. Files can be added using any of the three buttons in the upper left. Individual files can be excluded from processing by unchecking them; these can be subsequently removed from the list using the Remove Unchecked button.

The results of the process operation are saved in memory as a workspace. The workspace contains the results of the recognition operation, the source template, and references to the location on disk of the input files. The Save Workspace after Processing checkbox instructs the demo to write the workspace file to disk after it is created. Note a workspace is a feature of the demo and not incorporated into the toolkit itself.

To proceed to the next step, at least one file must be listed for processing and either a filename for the workspace specified or the option to save afterward deselected.

The next step is choosing an answer key to compare the processed worksheets to. This can be excluded by unchecking the Use Answer Key checkbox. To proceed to the next step, an answer key must be specified or the option disabled.

Once this information can be specified, the recognition operation occurs. Note this may take a while depending on the number of worksheets to process. Once the recognition operation finishes, the UI will automatically switch to the Review Results tab.

Review Results
This section displays results of processing operations or loaded workspaces from previous sessions.

The resulting UI is divided into two frames: Results and Statistics. Whether a frame is displayed can be toggled in the View dropdown menu.

The Review Frame
The Review Frame contains the extracted OMR data from processed worksheets. Regions with output style of CSV have each value in a distinct cell while combined/aggregated has the output from the entire region consolidated in the cell.

The grid output consists of a separate column for each processed region depending on its output style. Individual rows are created for the answer answer key, individual statistics for each response, and for each processed worksheet. Note the previously-defined Identifier field is appended to the processed filenames and adds context to each worksheet which may otherwise not be present in the filename.

Individual cells are color-coded based on their state. A cell can have one of six states:

  • Correct -- This cell matches the answer key.
  • Incorrect -- This cell does not match the answer key.
  • Needs Review -- This cell has been flagged for review based on the current review filters.
  • Reviewed Correct -- The value in this cell has been reviewed and now matches the answer key.
  • Reviewed Incorrect -- The value in this cell has been reviewed and does not match the answer key.
  • Answer Key -- The value in this cell is detected on the answer sheet and is the match others are compared against

The toolbar in the Review Frame has options specific for review purposes.

  • Edit Mode -- Edit Mode is disabled by default, indicated by the black text and "locked" icon. With Edit Mode disabled, the graph can be navigated and the individual cells selected.
  • Toggle Color Legend -- Displays or hides the Color Code pane.
  • Search -- Displays the Search dialogue.

Edit Mode

When Edit Mode is enabled, the text is green and displayed with the "unlocked" icon. Selecting a cell will launch the Review Panel specific to that cell.

The left side of the Review Window contains navigation options and information about the current selection. The right side displays the current worksheet, if available, with the current zone under review having been highlighted.

The left side contains, from top to bottom:

  • Worksheet navigation -- available worksheets can be selected directly using the dropdown, while the "Previous Worksheet" and "Next Worksheet" advance to the previous or next one available.
  • Answer Sheet -- this crop is the field from the corresponding answer sheet
  • Worksheet -- this crop if the field currently being examined
  • Detected Selection -- The value determined to be filled in by the OMR engine during recognition
  • Confidence -- the confidence value that the detected selection was recognized correctly by the OMR engine
  • New Selection -- the new value to be assigned for this field from the "Available Selections" section
  • Available Selections -- these are the options that can be selected for this specific field as specified by the template in the Template Editor section ("Blank" as a selection is automatically inserted to designate a field without any entries selected)
  • Detected Issues -- any issues detected during the OMR recognition process are listed here
  • Field navigation -- the drop-down can be used to select any field, while the "Previous" and "Next" buttons advance to the previous or next field. The "Skip Non-OMR Fields" checkbox, if checked, will cause these buttons to ignore any field that's not OMR-specific (such as a barcode).

The right side contains the current worksheet with the region of interest highlighted. Below this is the "Fields to Review" panel which allows farther control to fields which can be skipped using the "Previous" and "Next" buttons. All fields can be reviewed, or only specific ones. If "Specific Fields" is selected, the "Choose Filters..." buttons allow what criteria to be used to filter fields by.

Templates for common selections are available and can be selected with the radio buttons. Alternatively, choosing the radio button for "Customize" enables the checkboxes so they can be individually selected or deselected. With specific filters selected, only the OMR fields that satisfy the filters will be flagged for review. Using filters can facilitate verifying results of only a specific interest.

Color Code
The Color Code used for highlighting can be displayed via View -> Color Code. From here, the different colors can be modified or disabled completely.

Search Dialog
The Search Dialog can be invoked from the toolbar, and is also available via View -> Search or keyboard shortcut Ctrl + f.

Other items in the View menu include entries to toggle visibility of the Results panel and Statistics panel.

The statistics panel
The statistics panel displays a breakdown for each CSV field of the distribution each field has across all worksheets. These values are automatically updated if any of the values in the Results panel are modified. To invert the rows and columns, use the corresponding entry in the View menu.

The Review Menu
The review menu has options to change the answer key used and the identifier field displayed, as well as shortcuts to launch the review pane for either the answer sheets or worksheets.

This covers the OMR Processing Demo. For an example which deals with the code directly, see this other forum post.

Edited by user Thursday, October 12, 2023 8:55:41 AM(UTC)  | Reason: Updating to v22

Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.460 seconds.