←Select platform

PageRecognitionOptions Class

Summary

Specifies the different options for a Form page when it is added to a form using FormRecognitionEngine.AddFormPage for Forms or FormRecognitionEngine.AddMasterFormPage for Master Forms.

Syntax

C#
VB
C++
Java
[SerializableAttribute()] 
public class PageRecognitionOptions 
  
<SerializableAttribute()> 
Public Class PageRecognitionOptions  
public class PageRecognitionOptions 
    implements java.io.Serializable 
[SerializableAttribute()] 
public ref class PageRecognitionOptions  

Remarks

IncludeRectangles forms the region of the image that will be considered for feature extraction, any region outside the include region will be ignored.

If IncludeRectangles does not have a rectangle then the whole image will be considered as one include region for the feature extraction.

ExcludeRectangles forms the region of the image that will be ignored for feature extraction.

IncludeRectangles are considered first then the ExcludeRectangles will be excluded from the include region.

SvgDocument is the optional SVG document representation of this page if the original format supports loading as SVG. This is created and used by the recognition or processing engine.

Example

This example adds a page image to an attributes.

C#
VB
using Leadtools.Forms.Common; 
using Leadtools.Forms.Recognition; 
using Leadtools.Codecs; 
 
///This method add a page to the form attributes. 
public void AddPageToFormAttributes(RasterImage page, FormRecognitionAttributes attributes, FormRecognitionEngine engine) 
{ 
   PageRecognitionOptions pageOptions = new PageRecognitionOptions(); 
   pageOptions.AutoCleanUp = true; 
   pageOptions.UpdateImage = true; 
   pageOptions.TradeoffMode = FormsTradeoffMode.Accurate; 
   //Page is normal page, Not a card  
   pageOptions.PageType = FormsPageType.Normal; 
   pageOptions.IncludeRectangles.Add(new LeadRect(0, 0, page.Width, page.Height)); 
   pageOptions.ExcludeRectangles.Add(new LeadRect(page.Width * 6 / 10, 
                                                          page.Height * 4 / 10, 
                                                          page.Width * 3 / 10, 
                                                          page.Height * 2 / 10)); 
   pageOptions.RegionOfInterestRectangles.Add(new LeadRect(page.Width * 1 / 10, 
                                                                   page.Height * 1 / 10, 
                                                                   page.Width * 2 / 10, 
                                                                   page.Height * 2 / 10)); 
   FormRecognitionProperties properties = engine.GetFormProperties(attributes); 
   if (properties.IsMaster) 
   { 
      engine.OpenMasterForm(attributes); 
      engine.AddMasterFormPage(attributes, page, pageOptions); 
      engine.CloseMasterForm(attributes); 
   } 
   else 
   { 
      engine.OpenForm(attributes); 
      engine.AddFormPage(attributes, page, pageOptions); 
      engine.CloseForm(attributes); 
   } 
} 
Imports Leadtools.Forms.Common 
Imports Leadtools.Forms.Recognition 
Imports Leadtools.Codecs 
 
'''This method add a page to the form attributes. 
Public Sub AddPageToFormAttributes(page As RasterImage, attributes As FormRecognitionAttributes, engine As FormRecognitionEngine) 
   Dim pageOptions As New PageRecognitionOptions() 
   pageOptions.AutoCleanUp = True 
   pageOptions.UpdateImage = True 
   pageOptions.TradeoffMode = FormsTradeoffMode.Accurate 
 
   'Page is normal page, Not a card  
   pageOptions.PageType = FormsPageType.Normal 
   pageOptions.IncludeRectangles.Add(New LeadRect(0, 0, page.Width, page.Height)) 
   pageOptions.ExcludeRectangles.Add(New LeadRect(page.Width * 6 / 10, page.Height * 4 / 10, page.Width * 3 / 10, page.Height * 2 / 10)) 
   pageOptions.RegionOfInterestRectangles.Add(New LeadRect(page.Width * 1 / 10, page.Height * 1 / 10, page.Width * 2 / 10, page.Height * 2 / 10)) 
   Dim properties As FormRecognitionProperties = engine.GetFormProperties(attributes) 
   If properties.IsMaster Then 
      engine.OpenMasterForm(attributes) 
      engine.AddMasterFormPage(attributes, page, pageOptions) 
      engine.CloseMasterForm(attributes) 
   Else 
      engine.OpenForm(attributes) 
      engine.AddFormPage(attributes, page, pageOptions) 
      engine.CloseForm(attributes) 
   End If 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Recognition Assembly