Exemplo n.º 1
0
        /// <summary>
        /// 针对异常(通过初步智能处理后)的题目,在此处理
        /// 1、没有识别到的 增加阀门值,取最大面积的 +20
        /// 2、多识别的 减低阀门值,再比较取面积最大的和80%以内的 -20
        /// 3、取正常的所有面积平均,如果面积特别小的(小于平均的50%)算异常处理
        /// </summary>
        /// <param name="src">当前块的区域</param>
        /// <param name="question"></param>
        public void IntelligentChose(Image <Gray, byte> src, CVQuestion question)
        {
            if (question.ResultStatus == QuestionResultStatus.Right)
            {
                return;
            }



            int disThreshold     = question.ResultStatus == QuestionResultStatus.Absence ? stepThreshold + 5 : -stepThreshold;
            int currentThreshold = defatulThreshold + disThreshold;


            var optionList = question.NewOptionList(currentThreshold);

            //优化求结果和面积比
            for (int i = 0; i < optionList.Count; i++)
            {
                var currentCvRect = optionList[i];
                currentCvRect.CalAreaPercent(src);
            }

            question.IntelligentChose(optionList);

            question.Check();
        }
Exemplo n.º 2
0
 public void SetQuestionList(Dictionary <int, List <Rectangle> > dicRectList)
 {
     this.CVQuestionList = new List <CVQuestion>();
     foreach (var key in dicRectList.Keys)
     {
         var question = new CVQuestion(key, CVRectangle.NewList(dicRectList[key], this.Area.Location));
         this.CVQuestionList.Add(question);
     }
 }