Exemple #1
0
        public void Execute()
        {
            Console.WriteLine("Execute OCR");

            OCR.Statistics.Clear();
            OCR.Statistics.AddCounter("Processors", System.Environment.ProcessorCount);

            SISThreshold filter    = new SISThreshold();
            int          Threshold = filter.CalculateThreshold(m_Image.Image, m_Image.Area);

            OtsuThreshold filterOtsu = new OtsuThreshold();

            Threshold = filterOtsu.CalculateThreshold(m_Image.Image, m_Image.Area);

            PreprocessPage Processor = new PreprocessPage();

            Processor.Image    = m_Image;
            Processor.Treshold = m_Image.CalculateOtsuThreshold();
            m_Image.Threshold  = 170;
            Processor.Execute();

            resultBitmap = PageImage.CreateBitmapFromByteArray(m_Image.BinaryBytes, new Size(m_Image.Width, m_Image.Height));

            DetectComponents Step2 = new DetectComponents();

            Step2.Image = m_Image;
            Step2.Execute();

            AnalyseComponents Step3 = new AnalyseComponents();

            Step3.Image = m_Image;
            Step3.Execute();

            DetectSentences Step4 = new DetectSentences();

            Step4.Image = m_Image;
            Step4.Execute();

            ExtractFeatures Step5 = new ExtractFeatures();

            Step5.Image = m_Image;
            Step5.Execute();

            RecogniseComponent Step6 = new RecogniseComponent();

            Step6.Image = m_Image;
            Step6.Execute();

            ProcessSentences Step7 = new ProcessSentences();

            Step7.Image = m_Image;
            Step7.Execute();
        }