Leadtools.Forms.Recognition Namespace : PageRecognitionOptions Class |
[SerializableAttribute()] public class PageRecognitionOptions
'Declaration <SerializableAttribute()> Public Class PageRecognitionOptions
'Usage Dim instance As PageRecognitionOptions
public sealed class PageRecognitionOptions
function Leadtools.Forms.Recognition.PageRecognitionOptions()
[SerializableAttribute()] public ref class PageRecognitionOptions
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 doesn't 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.
'''This method add a page to the form attributes object. Public Sub AddPageToFormAttributes(ByVal page As RasterImage, _ ByVal attributes As FormRecognitionAttributes, _ ByVal engine As FormRecognitionEngine) Dim pageOptions As PageRecognitionOptions = New PageRecognitionOptions() pageOptions.AutoCleanUp = True pageOptions.UpdateImage = True pageOptions.IncludeRectangles.Add( _ New LogicalRectangle(0, 0, page.Width, page.Height, LogicalUnit.Pixel)) pageOptions.ExcludeRectangles.Add( _ New LogicalRectangle(page.Width * 6 / 10, _ page.Height * 4 / 10, _ page.Width * 3 / 10, _ page.Height * 2 / 10, _ LogicalUnit.Pixel)) pageOptions.RegionOfInterestRectangles.Add( _ New LogicalRectangle(page.Width * 1 / 10, _ page.Height * 1 / 10, _ page.Width * 2 / 10, _ page.Height * 2 / 10, _ LogicalUnit.Pixel)) 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
///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.IncludeRectangles.Add(new LogicalRectangle(0, 0, page.Width, page.Height, LogicalUnit.Pixel)); pageOptions.ExcludeRectangles.Add(new LogicalRectangle(page.Width * 6 / 10, page.Height * 4 / 10, page.Width * 3 / 10, page.Height * 2 / 10, LogicalUnit.Pixel)); pageOptions.RegionOfInterestRectangles.Add(new LogicalRectangle(page.Width * 1 / 10, page.Height * 1 / 10, page.Width * 2 / 10, page.Height * 2 / 10, LogicalUnit.Pixel)); 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); } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2