public FormsTradeoffMode TradeoffMode { get; set; }
The Leadtools.Forms.Common.FormsTradeoffMode setting to use for forms recognition.
Using modes other than Accurate may affect the results of the unknown forms recognition, but it has no effect on master forms. This Mode will work only if we select Complex method in RecognitionMethod
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);
}
}