示例#1
0
        public static IAsyncOCR MakeOCR(Image input, OCRCallback callback)
        {
            switch (Properties.Settings.Default.OCRDataSource)
            {
            case DataSource.Google:
                return(new GoogleImpl.AsyncOCR(input, callback));

            case DataSource.Microsoft:
                return(new MicrosoftImpl.AsyncOCR(input, callback));

            default:
                return(new DummyImpl.AsyncOCR(callback));
            }
        }
示例#2
0
        public AsyncOCR(Image image, OCRCallback callback = null)
        {
            this.image    = image.Copy();
            this.callback = callback;

            if (image == null)
            {
                _bigBox     = null;
                _smallBoxes = new OCRBox[0];
                _timeStamp  = "[empty]";
                isDone      = true;
                this.callback?.Invoke(this);
            }
            else
            {
                task = Task.Run(DoOCR);
            }
        }
示例#3
0
 public AsyncOCR(OCRCallback callback)
 {
     callback?.Invoke(this);
 }