public void Save(OcrPage ocrResult) { string ocrResultAsFormattedContent = ocrResult.GetFormattedText(); var filePath = CreateFilePath(); File.WriteAllText(filePath, ocrResultAsFormattedContent, Encoding.UTF8); }
public void Recognize(TesseractOcrSettings settings, VintasoftImage image) { using (TesseractOcr tesseractOcr = new TesseractOcr()) { tesseractOcr.Init(settings); tesseractOcr.SetImage(image); OcrPage ocrResult = tesseractOcr.Recognize(); _editor.EditorResult(ocrResult); } }
public void EditorResult(OcrPage ocrResult) { OcrObject[] ocrObjects = ocrResult.GetObjects(OcrObjectType.Word); foreach (var word in ocrObjects) { if (word.Confidence < MIN_CONFIDENCE) { removeObject.Add(word); } } OcrResultsEditor editor = new OcrResultsEditor(ocrResult); editor.RemoveObjects(removeObject.ToArray()); editor.ValidateResults(); _saveResult.Save(ocrResult); }