←Select platform

ExcludeRectangles Property

Summary
List of LeadRect objects which specify the portion of the page image that is not a part of the page features.

Syntax
C#
C++/CLI
Java
Python
public IList<LeadRect> ExcludeRectangles { get; } 
public java.util.List<LeadRect> getExcludeRectangles(); 
public: 
property IList<LeadRect>^ ExcludeRectangles { 
   IList<LeadRect>^ get(); 
} 
ExcludeRectangles # get  (PageRecognitionOptions) 

Property Value

List of LeadRect objects representing the excluded areas of the form.

Remarks

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

IncludeRectangles are Ored together then the ExcludeRectangles will be excluded from the include region.

Example
C#
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); 
   } 
} 
Requirements

Target Platforms

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

Leadtools.Forms.Recognition Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.