public ReceiptService() { _imageFormating = new ImageFormating(); _ocr = new EmguOcr(); _dataConverter = new DataConverter(); _dataManager = new ItemManager(); }
public ReceiptService(IImageFormating imageFormating, IOcr ocr, IDataConverter dataConverter, IItemManager dataManager) { _imageFormating = imageFormating; _ocr = ocr; _dataConverter = dataConverter; _dataManager = dataManager; }
public DocumentLabBase() { this.windsorContainer = new WindsorContainer(); this.windsorContainer.Install(FromAssembly.This()); this.ocr = windsorContainer.Resolve <IOcr>(); this.imageProcessor = windsorContainer.Resolve <IImageProcessor>(); this.pageAnalyzer = windsorContainer.Resolve <IPageAnalyzer>(); this.pageTrimmer = windsorContainer.Resolve <IPageTrimmer>(); this.documentInterpreter = new Interpreter(); }
public OcrTranslateOverlay(ITranslate translate, IOverlay internalOverlay, IScreenImageProvider screenImageProvider, IOcr ocr, IOcrTranslateOverlayConfiguration ocrTranslateOverlayConfiguration, ILogger <OcrTranslateOverlay> log) { _translate = translate; _internalOverlay = internalOverlay; _screenImageProvider = screenImageProvider; _ocr = ocr; _ocrTranslateOverlayConfiguration = ocrTranslateOverlayConfiguration; _log = log; if (_ocrTranslateOverlayConfiguration.CaptureArea == null) { throw new ArgumentNullException(nameof(_ocrTranslateOverlayConfiguration.CaptureArea), "Screen capture area was not configured"); } }
public OcrQuotaGuard(IOcr ocrImplementation, IQuotaRepository quotaRepository, IEnumerable <IQuotaConfig> configs) : base(quotaRepository, configs, QuotaType.GoogleOcr) { _ocrImplementation = ocrImplementation; }
public OcrDebugCache(IOcr decorated, IOcrConfig configuration) { _decorated = decorated; _configuration = configuration; }
public ReceiptMaking(IOcr ocr, IShopDetection shopDetection) { _ocr = ocr; _shopDetection = shopDetection; }
public ReceiptMaking() { _ocr = new EmguOcr(); _shopDetection = new ShopDetection(); }
public override void Dispose() { base.Dispose(); if (_ocr != null) { _ocr.Dispose(); _ocr = null; } if (_recognitionResultLogger != null) Disposer.DisposeObject(_recognitionResultLogger); }
public ReceiptService(IOcr ocr, IDataConverter dataConverter, IDataManager dataManager) { _ocr = ocr; _dataConverter = dataConverter; _dataManager = dataManager; }
private void CreateOcr() { _ocr = new Ocr.Ocr(); _ocr.SetEventsHandler(this); _ocr.StampTestLevel = _config.Ocr.Stamp.TestLevel; _ocr.ModelFilePath = Path.Combine( _fileSystemManager.GetDataDirectoryPath(FileType.RuntimeData), MODEL_FILE_NAME); _ocr.Init(); }
public int GetHalfToneBuffer(IOcr ocr, short side, int x, int y, int height, int width, MemoryBlock image) { if (!_config.Ocr.GrayAnalysis.Enabled) return -1; try { var res = _scannerManager.GetHalftoneBuffer( (ScannedSide)side, (short)x, (short)y, (short)width, (short)height, image); if (res && _config.DebugImageSaving.Squares) { var imageDirectoryPath = _fileSystemManager.GetDataDirectoryPath(FileType.ScanningImage); long requiredSize = width * height; if (ReserveSpaceForImage(requiredSize)) { var filePathSb = GetImageFileName("SQ"); filePathSb.Insert(0, imageDirectoryPath + '/'); filePathSb.AppendFormat("_S{0}_X{1}_Y{2}_W{3}_H{4}.tif", side, x, y, width, height); TiffImageHelper.SaveToFile(filePathSb.ToString(), ImageType.Halftone, image, width, height); } } return res ? width * height : -1; } catch (Exception ex) { Logger.LogError(Message.RecognizerGetBufferError, ex); return -1; } }
public int GetBinaryThreshold(IOcr ocr, short side) { int res = side == 0 ? _scannerManager.BinarizationThresholdTop : _scannerManager.BinarizationThresholdBottom; Logger.LogVerbose(Message.RecognizerBinarizationThreshold, side, res); return res; }
public void Error(IOcr ocr, int errorCode, string message) { Logger.LogError(Message.RecognizerOcrError, errorCode, message); }
public OcrCoordinator(IOcr decorated, ISpatialTextConsolidator spatialTextConsolidator, ILogger <OcrCoordinator> logger) { _decorated = decorated; _spatialTextConsolidator = spatialTextConsolidator; _logger = logger; }
public OcrService(ISpatialTextConsolidator spatialTextConsolidator, IMachineOcrRepository machineOcrRepository, IOcr ocr) { _spatialTextConsolidator = spatialTextConsolidator; _machineOcrRepository = machineOcrRepository; _ocr = ocr; }
public void AppendToLog(IOcr ocr, string message) { Logger.LogVerbose(Message.RecognizerOcrDebug, message); }