Пример #1
0
    private void btnReSampling_Click(object sender, EventArgs e)
    {
      var preProc = new PreProcessing();

      var traceGroup = _drawingInk.Ink.ToTraceGroup();
      var resamplingTraceGroup = preProc.ResampleTraceGroup(traceGroup);

      _resultInk.Enabled = false;
      _resultInk.Ink = resamplingTraceGroup.ToInk();
      _resultInk.Enabled = true;

      txtDrawingResult.Text = ReadTraceGroupInUnipenFormat(resamplingTraceGroup);
    }
Пример #2
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);
    }