mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

[Bug report] DigitalInkRecognition Writing Area size setting doesn't affect the recognition

Open RogVok opened this issue 2 years ago • 2 comments

Describe the bug So I'm playing with the ios DigitalInkRecognition quickstart and I believe setting the Writing Area size doesn't make the desired affect on recognition.

What I've done to test it is shrunk the drawnImage and recognizedImage to 300x300 size. And passed that size as a context to the recognizer:

recognizer.recognize(
      ink: ink,
//HERE:
      context: DigitalInkRecognitionContext(preContext: "", writingArea: WritingArea(width: 300.0, height: 300.0)),
      completion: {
        [unowned self, recognizedInk]
        (result: DigitalInkRecognitionResult?, error: Error?) in
        if let result = result, let candidate = result.candidates.first {
          recognizedInk.text = candidate.text
          var message = "Recognized: \(candidate.text), with writing area of 300x300"

          self.delegate?.displayMessage(message: message)
        }

Here is what I get:

  1. Drawing lowercase 'o', getting a lowercase 'o': https://i.imgur.com/cv0Gx74.jpg
  2. Drawing big, uppercase 'O', still getting a lowercase 'o': https://i.imgur.com/4VDAQy0.jpg

Maybe I'm misunderstanding how that should work. If so could you please tell me how can I get an uppercased 'O' in this example?

Thank you!

P.S. The page from docs: https://developers.google.com/ml-kit/vision/digital-ink-recognition/ios#writing-area

RogVok avatar Apr 18 '23 21:04 RogVok

Thanks for reporting this, it is a known issue and we've been actively working on this.

miworking3 avatar May 02 '23 15:05 miworking3

Thank you for working on this!

RogVok avatar May 03 '23 00:05 RogVok