コード例 #1
0
        /// <summary>
        /// Initializes flags, lists, and delegates to have a valid
        /// starting point to start the assistant.
        /// </summary>
        public MatchingAssistant(MatchingParam parSet)
        {
            parameterSet        = parSet;
            NotifyIconObserver  = new MatchingDelegate(dummy);
            NotifyParamObserver = new AutoParamDelegate(dummyS);
            ModelID             = new HShapeModel();
            homSc2D             = new HHomMat2D();
            TestImages          = new Hashtable(10);
            tResult             = new MatchingResult();

            contrastLowB    = 0;
            contrastUpB     = 255;
            scaleStepLowB   = 0.0;
            scaleStepUpB    = (double)19.0 / 1000.0;
            angleStepLowB   = 0.0;
            angleStepUpB    = (double)(112.0 / 10.0) * Math.PI / 180.0;
            pyramLevLowB    = 1;
            pyramLevUpB     = 6;
            minContrastLowB = 0;
            minContrastUpB  = 30;

            findAlways        = false;
            createNewModelID  = true;
            ModelID           = new HShapeModel();
            GrayTemplate      = new HTemplate();
            onExternalModelID = false;
        }
コード例 #2
0
ファイル: MatchingModule.cs プロジェクト: Gz1d/Gz
        /// <summary>
        /// 初始化模板匹配参数
        /// </summary>
        /// <param name="parSet"></param>
        public void InitMatchingParam(MatchingParam parSet)
        {
            m_MatchingParam             = parSet;
            m_MatchingParam.mNumMatches = 1;
            m_MatchingParam.mMaxOverlap = 0.5;
            m_MatchingParam.mSubpixel   = "least_squares";

            if (m_MatchAssistant == null)
            {
                m_MatchAssistant = new MatchingAssistant(m_MatchingParam);
            }
        }