Aspose.OCR.Examples.CSharp.FormattingAndManipulatingOMR.SetPageLevelThreshold.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:SetPageLevelThreshold
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_OCR();

            // Load template file
            OmrTemplate template = OmrTemplate.Load(dataDir + "questions.amr");

            // Load the image to be analyzed
            OmrImage image = OmrImage.Load(dataDir + "answers.jpg");

            // Get the first page of the template
            OmrPage page = template.Pages[0];

            // Create page configurations
            page.Configuration = new OmrConfig();

            // Set fill threshold
            page.Configuration.FillThreshold = 0.21;

            // Create an instance of OmrEngine and pass object of OmrTemplate as parameter
            OmrEngine engine = new OmrEngine(template);

            // Extract the data
            OmrProcessingResult result = engine.ExtractData(new OmrImage[] { image });
            // ExEnd:SetPageLevelThreshold
        }
    }
SetPageLevelThreshold