1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //
- // 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,
- }
- /// <summary>
- /// OCR识别结果
- /// </summary>
- public sealed class OCRResult
- {
- /// <summary>
- /// 文本处理状态
- /// </summary>
- public EnumOCRProcessStatus OCRProcessStatus { get; set; }
- /// <summary>
- /// 文本框
- /// </summary>
- public TextBlock[] TextBlocks { get; set; }
- /// <summary>
- /// 文本框检测耗时
- /// </summary>
- public float TimeDetectTextBox { get; set; }
- /// <summary>
- /// 文字提取耗时(处理完所有文本框)
- /// </summary>
- public float TimeRecogText { get; set; }
- /// <summary>
- /// 处理完一张图片的总耗时
- /// </summary>
- public float TimeAllProcessOneImage { get; set; }
- public OCRResult(TextBlock[] textBlocks, float timeDetectTextBox, float timeRecogText, float timeAllProcessOneImage)
- {
- TextBlocks = textBlocks;
- TimeDetectTextBox = timeDetectTextBox;
- TimeRecogText = timeRecogText;
- TimeAllProcessOneImage = timeAllProcessOneImage;
- }
- }
- }
|