示例#1
0
    private int _numOfChoice = 5; // K value in k-NN

    public NNRecognizer()
    {
      _featureExtractor = new PointFloatShapeFeatureExtractor();
      _preProc = new PreProcessing();
    }
示例#2
0
    private void btnFeature_Click(object sender, EventArgs e)
    {
      var traceGroup = _resultInk.Ink.ToTraceGroup();
      var featureExtractor = new PointFloatShapeFeatureExtractor();

      var features = featureExtractor.ExtractFeature(traceGroup);

      var str = new StringBuilder();
      foreach (var feature in features)
      {
        str.AppendLine(string.Format("{0}  {1}  {2}  {3}  {4}", feature.X, feature.Y, feature.SinTheta, feature.CosTheta,
                                     feature.IsPenUp));

      }
      str.AppendLine("--- Total Point = " + features.Count);
      txtFeature.Text = str.ToString();
    }
示例#3
0
    private void btnEuclidean_Click(object sender, EventArgs e)
    {
      var featureExtractor = new PointFloatShapeFeatureExtractor();
      var preProc = new PreProcessing();

      var traceGroup = _drawingInk.Ink.ToTraceGroup();
      var sampledTraceGroup = preProc.ResampleTraceGroup(chkIsNormalized.Checked?preProc.NormalizeSize(traceGroup): traceGroup);
      var features = featureExtractor.ExtractFeature(sampledTraceGroup);

      var testTraceGroup = _resultInk.Ink.ToTraceGroup();
      var sampledTestTraceGroup = preProc.ResampleTraceGroup(chkIsNormalized.Checked?preProc.NormalizeSize(testTraceGroup): testTraceGroup);
      var testFeatures = featureExtractor.ExtractFeature(sampledTestTraceGroup);
      
      var eucDistance = featureExtractor.ComputeEuclideanDistance(features, testFeatures);

      MessageBox.Show(@"Euclidean Distance = " + eucDistance);
    }
示例#4
0
 public TrainRecognizer()
 {
   _featureExtractor = new PointFloatShapeFeatureExtractor();
   _inkFile = new InkFile();
   _preProc = new PreProcessing();
 }