コード例 #1
0
        /// <summary>
        /// Analyze the drawn curve and find associated learnt one
        /// </summary>
        private void StartAnalyze()
        {
            //form_top.MakeNonTopMost();
            //if (cMS_MatchedGestures.Visible)
            //    form_top.CloseAndClearContextMenu(cMS_MatchedGestures);

            Debug.WriteLine("Thread StartAnalyze started");
            int approxPoints = Config.User.NnInputSize / 2 + 1;

            double[] nnInput = null;
            if (m_curve == null)
            {
                return;
            }
            else
            {
                //Get scaled input cannot last to long otherwise might be modified with new curve
                try { nnInput = m_curve.GetScaledInput(); }
                catch (Exception ex) { nnInput = null; }
            }
            m_curve = null;
            if (nnInput == null)
            {
                return;
            }

            double divergence;
            string nn_name = m_network.RecognizeCurve(nnInput, out divergence);

            m_threadID = Thread.CurrentThread.ManagedThreadId;
            GesturesCollection recognizedGestures = GetRecognizedGestures(nn_name);

            ExecuteRecognizedGestures(recognizedGestures);
        }
コード例 #2
0
        void MyMouse_MouseStoped(object sender, EventArgs e)
        {
            if (form_top.Points.Count <= 1)
            {
                return;
            }
            m_curve = new MyCurve(form_top.Points, false);
            int approxPoints = Config.User.NnInputSize / 2 + 1;

            double[] nnInput = m_curve.GetScaledInput();
            if (nnInput == null)
            {
                form_top.ShowToolTip(Unknown_gesture);
                return;
            }
            double divergence;
            string nn_name = m_network.RecognizeCurve(nnInput, out divergence);

            ShowToolTip(nn_name);
        }
コード例 #3
0
 void MyMouse_MouseStoped(object sender, EventArgs e)
 {
     if (form_top.Points.Count <= 1) return;
     m_curve = new MyCurve(form_top.Points, false);
     int approxPoints = Config.User.NnInputSize / 2 + 1;
     double[] nnInput = m_curve.GetScaledInput();
     if (nnInput == null)
     {
         form_top.ShowToolTip(Unknown_gesture);
         return;
     }
     double divergence;
     string nn_name = m_network.RecognizeCurve(nnInput, out divergence);
     ShowToolTip(nn_name);
 }