←Select platform

FindCandidateFormFieldsCommand Class

Summary

Extracts the candidate form fields from a bitmap using various options. There are two types of fields that can be extracted: OMR fields and text fields.

Syntax
C#
VB
C++
public class FindCandidateFormFieldsCommand : RasterCommand 
Public Class FindCandidateFormFieldsCommand 
   Inherits RasterCommand 
public: 
   ref class FindCandidateFormFieldsCommand : RasterCommand 
Remarks

If an image is skewed, deskew it first before running FindCandidateFormFieldsCommand.

FindCandidateFormFieldsCommand supports 8-bit, 12-bit and 16-bit grayscale images, as well as 24-bit, 32-bit, 48-bit, and 64-bit colored images. This function does not support 32-bit grayscale images. If a 32-bit grayscale image is passed to this function, it returns the ERROR_GRAY32_UNSUPPORTED error code.

FindCandidateFormFieldsCommand does not support setting rectangular regions.

Example

Runs the FindCandidateFormFieldsCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void FindCandidateFormFieldsCommandExample() 
{ 
 
   RasterCodecs codecs = new RasterCodecs(); 
 
   RasterImage image = Load(@"D:\\forms\\OMR\\300_OMR_sample.tif", 0, Leadtools.Codecs.CodecsLoadByteOrder.Bgr, 1, 1); 
   FindCandidateFormFieldsCommand FindFields = new FindCandidateFormFieldsCommand(); 
   FindFields.HorizontalLineMinimumLength = (char)10; 
   FindFields.VerticalLineMinimumLength = (char)3; 
   FindFields.Run(image); 
 
   TextField[] textFields = findFields.TextFieldAreas; 
   OMRField[] omrFields = findFields.OMRFieldAreas; 
 
 
   foreach (TextField field in textFields) 
   { 
      // Function TODO : Drawing rectangle field.Bounds 
      // Function TODO : Drawing rectangle field.FilledAreaBounds 
   } 
          
   foreach (OMRField field in omrFields) 
   { 
      if (field.FieldType == BoxOMR) 
      { 
         // Function TODO : Drawing rectangle field.UnFilledBound 
      } 
      { 
         // Function TODO : Drawing circle field.UnFilledBound 
      } 
   } 
          
   image.Dispose(); 
 
   codecs.Dispose(); 
 
    // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!  
} 
Requirements
Target Platforms
Help Version 21.0.2021.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly