←Select platform

OmrAnalysisEngine Class

Summary

Specifies an analysis engine for OMR forms to compute their statistics and grades.

Syntax
C#
VB
C++
Java
public class OmrAnalysisEngine 
public class OmrAnalysisEngine 
Public Class OmrAnalysisEngine 
public: 
   ref class OmrAnalysisEngine 
Remarks

OmrAnalysisEngine can be used to compute filled-in forms grades. The answers get marked based on the filled-in form provided as an answer key in the Constructor of this class.

If no answer key is available, users can fill the OmrAnalysisEngine.Grades property by creating grade objects manually.

After properly filling the OmrAnalysisEngine.Grades and the OmrAnalysisEngine.FilledForms properties, the user can grade forms and generate the OmrGradesStatistics object using OmrAnalysisEngine.GradeForms.

Example

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.

C#
using Leadtools; 
using Leadtools.Barcode; 
using Leadtools.Codecs; 
using Leadtools.Forms.Processing.Omr; 
using Leadtools.Ocr; 
 
public static void PerformAnalysis(List<IRecognitionForm> recognizedForms, IRecognitionForm answers) 
{ 
   int threshold = 70; // pass/fail threshold value 
   OmrAnalysisEngine omrAnalysisEngine = new OmrAnalysisEngine(recognizedForms, answers); 
   omrAnalysisEngine.PassingScore = threshold; 
 
   // this call generates both the OmrGradesStatistics and populates the IRecognitionForm.Grade and Score properties 
   OmrGradesStatistics statistics = omrAnalysisEngine.GradeForms(); 
 
   // print out the generated basic statistics (skipping the histogram) 
   Console.WriteLine("Statistics"); 
   PropertyInfo[] properties = statistics.GetType().GetProperties(); 
   for (int i = 0; i < properties.Length; i++) 
   { 
      PropertyInfo pi = properties[i]; 
      if (pi.PropertyType == typeof(Double) || pi.PropertyType == typeof(UInt32)) 
      { 
         Console.WriteLine("{0}:\t{1}", pi.Name, pi.GetValue(statistics)); 
      } 
   } 
 
   // print out the final grade for each exam 
   for (int i = 0; i < recognizedForms.Count; i++) 
   { 
      IRecognitionForm form = recognizedForms[i]; 
      string text = string.Format("{0}:\t {1}%", form.Name, form.Grade.ToString("0.#")); 
      Console.WriteLine(text); 
   } 
} 
Requirements
Target Platforms
Help Version 21.0.2021.3.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Processing.Omr Assembly