Esempio n. 1
0
        static void Main(string[] args)
        {
            //var dir = @"D:\Projects\TessWrapper\tesseract";
            //System.IO.Directory.SetCurrentDirectory(dir);
            //var imageName = @"D:\Projects\TextLayerAnalyzer\Samples\Bupa\{imageName}.tif";
            var imageName   = "2019-11-ээ";
            var document    = GetDoc(imageName);
            var dClassifier = new Classifier();

            //dClassifier.AddClass(DocClassesCollector.TawuniaLegacy());
            //dClassifier.AddClass(DocClassesCollector.BupaLegacy());
            dClassifier.AddClass(DocClassesCollector.Act());
            var docs     = dClassifier.Classify(document);
            var analyzer = new Analyzer();
            var models   = new List <ResultModel>();

            foreach (var doc in docs)
            {
                analyzer.AnalyzeDocument(doc);
                var model = ResultHandler.GetResultModel(doc);
                models.Add(model);
            }
            var resPath = $@"112.xml";

            //var resPath = $@"D:\Projects\TextLayerAnalyzer\{imageName}.xml";
            ResultHandler.SaveModel(models, resPath);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //var dir = @"C:\ProgramData\EasyData\EasySeparate\Profiles\Tesseract\ImageAnalyzer";
            //System.IO.Directory.SetCurrentDirectory(dir);
            if (args.Length != 2)
            {
                throw new Exception("");
            }
            var pathToImage     = args[0];
            var pathToResultXml = args[1];
            var document        = GetDoc(pathToImage);
            var dClassifier     = new Classifier();

            dClassifier.AddClass(DocClassesCollector.TawuniaLegacy());
            dClassifier.AddClass(DocClassesCollector.BupaLegacy());
            var docs     = dClassifier.Classify(document);
            var analyzer = new Analyzer();
            var models   = new List <ResultModel>();

            foreach (var doc in docs)
            {
                analyzer.AnalyzeDocument(doc);
                var model = ResultHandler.GetResultModel(doc);
                models.Add(model);
            }
            ResultHandler.SaveModel(models, pathToResultXml);
        }