Aspose.OCR.Examples.CSharp.FormattingAndManipulatingOCR.PreprocesImagesFromOCROperation.Run C# (CSharp) Method

Run() public static method

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

            // Initialize an instance of OcrEngine.
            OcrEngine ocr = new OcrEngine();

            // Set the Image property by loading the image from file path location.
            ocr.Image = ImageStream.FromFile(dataDir);

            // Set the SavePreprocessedImages property to false.
            ocr.Config.SavePreprocessedImages = true;

            if (ocr.Process())
            {
                // Do processing
            }
            // ExEnd:PreprocesImagesFromOCROperation
        }
    }
PreprocesImagesFromOCROperation