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)); } }
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); } }
public AsyncOCR(OCRCallback callback) { callback?.Invoke(this); }