private void RecognizeHandler() { DateTime dNow = DateTime.Now; var container = _eulerContainersCache[SelectedLanguage]; TextRecognizer recognizer = new TextRecognizer(container); var report = recognizer.Recognize(_sourceBitmap); // Выводим RecognitionTime = (DateTime.Now - dNow).ToString(); RecognitionResult = report.RawText(); // визуализируем найденные итоги var visualizedImage = new Bitmap(_sourceBitmap); RecognitionVisualizerUtils.Visualize(visualizedImage, report); SourceImage = visualizedImage.ToBitmapSource(); }
private void Analyze() { //var dic = GetEulerContainer(@"..\..\..\Qocr.Dics\RU-ru.bin"); var dic = GetEulerContainer(@"..\..\Qocr.Dics\EN-en.bin"); DateTime nowInit = DateTime.Now; // ИСПОЛЬЗУЙ Gen.bin _recognizer = _recognizer ?? new TextRecognizer(dic); DateTime nowRecognition = DateTime.Now; var bitmap = BitmapUtils.BitmapFromSource((BitmapSource)ApproximatedImage); var report = _recognizer.Recognize(bitmap); MessageBox.Show( $"Init time: {nowRecognition - nowInit}\n\rRecognition time: {DateTime.Now - nowRecognition}"); RecognitionVisualizerUtils.Visualize(bitmap, report); ApproximatedImage = BitmapUtils.SourceFromBitmap(bitmap); }