// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Emgu.CV; using System.Collections.Generic; namespace IDCardRecognitionLibs.IDCardRecognitionCore { public enum EnumOCRProcessStatus { Failed = 0, Successed, GetEmptyTxtBoxes, GetEmptyPartImgs, GetEmptyTxtLines, } /// /// OCR识别结果 /// public sealed class OCRResult { /// /// 文本处理状态 /// public EnumOCRProcessStatus OCRProcessStatus { get; set; } /// /// 文本框 /// public TextBlock[] TextBlocks { get; set; } /// /// 文本框检测耗时 /// public float TimeDetectTextBox { get; set; } /// /// 文字提取耗时(处理完所有文本框) /// public float TimeRecogText { get; set; } /// /// 处理完一张图片的总耗时 /// public float TimeAllProcessOneImage { get; set; } public OCRResult(TextBlock[] textBlocks, float timeDetectTextBox, float timeRecogText, float timeAllProcessOneImage) { TextBlocks = textBlocks; TimeDetectTextBox = timeDetectTextBox; TimeRecogText = timeRecogText; TimeAllProcessOneImage = timeAllProcessOneImage; } } }