Example #1
0
    private void btnSmooth_Click(object sender, EventArgs e)
    {
      var traceGroup = _drawingInk.Ink.ToTraceGroup();

      //txtUnipen.Text = ReadTraceGroupInUnipenFormat(traceGroup);

      var preProc = new PreProcessing();
      var newTraceGroup = preProc.SmoothenTraceGroup(traceGroup);

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

      txtDrawingResult.Text = ReadTraceGroupInUnipenFormat(newTraceGroup);
    }
Example #2
0
    private int _numOfChoice = 5; // K value in k-NN

    public NNRecognizer()
    {
      _featureExtractor = new PointFloatShapeFeatureExtractor();
      _preProc = new PreProcessing();
    }
Example #3
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);
    }
Example #4
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);
    }
Example #5
0
 public TrainRecognizer()
 {
   _featureExtractor = new PointFloatShapeFeatureExtractor();
   _inkFile = new InkFile();
   _preProc = new PreProcessing();
 }