Пример #1
0
        private void btn_learn_Click(object sender, EventArgs e)
        {
            if (mPicBox1.Image == null)
            {
                return;
            }
            switch (modleType)
            {
            case Type.None: MessageBox.Show("请先选择模板类型!");
                break;

            case Type.Match:
                match.LearnPattern(roi);
                break;

            case Type.Find:
                find.Learn(roi);
                break;

            case Type.Ocr:
                MessageBox.Show("请右键字符学习!");
                break;

            default:
                break;
            }
            UpdateToUI();
        }
Пример #2
0
        private void _MatchLearnPattern(EBaseROI image24, PicturePanelC ppc)
        {
            EC24Image1Roi1.Attach(image24);
            EC24Image1Roi1.SetPlacement(ppc.Location.X + 1, ppc.Location.Y + 1, ppc.Width - 8, ppc.Height - 8);

            m_match.LearnPattern(EC24Image1Roi1);//学习ROI模型
            m_match.DontCareThreshold = 80;
        }
Пример #3
0
 public void LearnPattern(
     EROIBW8 patternforTeaching)
 {
     if (patternforTeaching == null)
     {
         throw new ArgumentNullException("patternforTeaching");
     }
     EMatcher_.ClearImage();
     EMatcher_.LearnPattern(patternforTeaching);
     isPatternLearned_ = true;
 }
Пример #4
0
        public void LearnPattern(
            EROIBW8 patternforTeaching1,
            EROIBW8 patternforTeaching2)
        {
            if (patternforTeaching1 == null)
            {
                throw new ArgumentNullException("patternforTeaching1");
            }
            if (patternforTeaching2 == null)
            {
                throw new ArgumentNullException("patternforTeaching2");
            }
            //EMatcher1_.ClearImage();
            EMatcher1_.LearnPattern(patternforTeaching1);

            //EMatcher2_.ClearImage();
            EMatcher2_.LearnPattern(patternforTeaching2);
            isPatternReady = true;
        }