0

I am making a math worksheet app where you can write in the answer below the problem using an InkCanvas. The problem is that if you write a "1" the way most people do it looks like "|", and is recognized as a vertical bar. It seems there should be some way to set the InkRecognizerContainer to recognize only numbers, but I can't find any way to do it. Is this possible?

Here's my current code:

var recognitionResults = await inkRecognizerContainer.RecognizeAsync(inkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All)
string answerString = string.Empty;

foreach (var result in recognitionResults)
{
    answerString += result.GetTextCandidates()[0];
}

int submittedAnswer = Convert.ToInt32(answerString);

1 Answers1

1

The problem is that if you write a "1" the way most people do it looks like "|", and is recognized as a vertical bar

This should be related to the handwriting recognizer you chosen, check the official Simple inking sample

The second scenario show us how to recognize handwriting from ink strokes using different handwriting recognizer

This is the result from Microsoft English (US) Handwriting Recognizer:

Recognizer Result

It seems there should be some way to set the InkRecognizerContainer to recognize only numbers

There is no such setting for InkRecognizer to recognize only number, the only possible way is to check the result and notify user to rewrite again for better recognition effect.

Franklin Chen - MSFT
  • 4,845
  • 2
  • 17
  • 28
  • Huh. That is the recognizer I'm using. Will try later today. –  Nov 10 '15 at 12:02
  • Is there any way to bring Microsoft English (US) Handwriting Recognizer with app? User can use it immediately without install in Region and Language – quangkid Dec 22 '17 at 01:59