コード例 #1
0
        public static List <IGenericOcrRunner> GetStandardOcrs(IOcrCache ocrCache, StandardOcrSettings standardOcrSettings)
        {
            List <IGenericOcrRunner> genericOcrRunners = new List <IGenericOcrRunner>();

            if (standardOcrSettings.AwsOcrSettings != null)
            {
                var awsSettings = standardOcrSettings.AwsOcrSettings;
                genericOcrRunners.Add(new AwsOcrService(ocrCache, awsSettings.AccessKey, awsSettings.SecretKey));
            }

            if (standardOcrSettings.AzureOcrSettings != null)
            {
                var azureSettings = standardOcrSettings.AzureOcrSettings;
                genericOcrRunners.Add(new AzureOcrExecutor(ocrCache, azureSettings.SubscriptionKey, azureSettings.Endpoint));
            }

            if (standardOcrSettings.GoogleOcrSettings != null)
            {
                var googleSettings = standardOcrSettings.GoogleOcrSettings;
                genericOcrRunners.Add(new GoogleOcrService(ocrCache, googleSettings.ApiToken));
            }

            if (standardOcrSettings.TesseractOcrSettings != null)
            {
                var tesseractSettings = standardOcrSettings.TesseractOcrSettings;
                genericOcrRunners.Add(new TesseractService(ocrCache, tesseractSettings.TesseractDir, tesseractSettings.DataDir));
            }

            if (standardOcrSettings.WindowsOcrSettings != null)
            {
                genericOcrRunners.Add(new WindowsOcrExecutor(ocrCache));
            }
            return(genericOcrRunners);
        }
コード例 #2
0
 public StandardMultiOcrRunnerFactory(StandardOcrSettings settings, IOcrCache ocrCache)
 {
     this.settings = settings;
     this.ocrCache = ocrCache;
 }
コード例 #3
0
 public StandardMultiOcrRunnerFactory(StandardOcrSettings settings, string cacheRootDirectory) :
     this(settings, new FileStorageOcrCache(cacheRootDirectory))
 {
 }