private bool LoadAndInitializeOcrTemplate(string filePath) { if (string.IsNullOrEmpty(filePath)) { UpdateOCRLabel(); return(false); } var loadedOcrConfig = OCRTemplate.LoadFile(filePath); if (loadedOcrConfig == null) { filePath = null; } ArkOCR.OCR.ocrConfig = loadedOcrConfig; UpdateOCRLabel(filePath); if (loadedOcrConfig == null) { return(false); } InitLabelEntries(); nudResizing.Value = ArkOCR.OCR.ocrConfig.resize == 0 ? 1 : (decimal)ArkOCR.OCR.ocrConfig.resize; CbTrainRecognition.Checked = ArkOCR.OCR.ocrConfig.RecognitionPatterns.TrainingSettings.IsTrainingEnabled; CbSkipNameRecognition.Checked = ArkOCR.OCR.ocrConfig.RecognitionPatterns.TrainingSettings.SkipName; CbSkipTribeRecognition.Checked = ArkOCR.OCR.ocrConfig.RecognitionPatterns.TrainingSettings.SkipTribe; CbSkipOwnerRecognition.Checked = ArkOCR.OCR.ocrConfig.RecognitionPatterns.TrainingSettings.SkipOwner; return(true); }
private bool LoadOCRTemplate(string filePath) { if (string.IsNullOrEmpty(filePath)) { return(false); } ArkOCR.OCR.ocrConfig = OCRTemplate.LoadFile(filePath) ?? new OCRTemplate(); UpdateOCRLabel(filePath); UpdateOcrFontSizes(); InitLabelEntries(); nudResizing.Value = ArkOCR.OCR.ocrConfig.resize == 0 ? 1 : (decimal)ArkOCR.OCR.ocrConfig.resize; return(true); }