5

I found a problem with the Vision framework in my app using iOS 15. I write recognized text in a string and under iOS 15 the result is not in the right order.

Maybe an example would explain it better :-)

Text to scan:

Hello, my name is Michael and I am the programmer of an app
named Scan2Clipboard.
Now I've focused a problem with
VNRecognizeTextRequest and iOS 15.

Result under iOS 14:

Hello, my name is Michael and I am the programmer of an app
named Scan2Clipboard.
Now I've focused a problem with
VNRecognizeTextRequest and iOS 15.

Result under iOS 15:

Hello, my name is Michael and I am the programmer of an app
Now I've focused a problem with
named Scan2Clipboard.
VNRecognizeTextRequest and iOS 15.

I've tried some other apps from the App Store (Scan&Copy, Quick Scan). They show the same behavior. They're also using the Vision framework. Does anyone else also have this issue?

The first image below is the source and the second image is the result. Please notice the "Für den Mürbteig" jumps in the middle of the result:

Example:

enter image description here

TylerP
  • 9,600
  • 4
  • 39
  • 43
Michael
  • 616
  • 5
  • 20

2 Answers2

0

If I change the maximumRecognitionCandidates from 1 to a higher number the results are getting better. With maximumRecognitionCandidates 3 or higher the result is in the right order an the value makes no difference until 9. With value 10 the result ist the same like value 1.

So this is only a workaround at the moment.

let maximumRecognitionCandidates = 9
            for observation in observations {
                guard let candidate = observation.topCandidates(maximumRecognitionCandidates).first else { continue }
                entireRecognizedText += "\(candidate.string)\n"
Michael
  • 616
  • 5
  • 20
  • 1
    Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - [From Review](/review/low-quality-posts/29935612) – Blastfurnace Sep 28 '21 at 02:26
  • Changing maximumRecongitionCandidates to a higher value solves the problem. But I don‘t know if this is the right solution – Michael Sep 28 '21 at 04:34
  • This is the same problem. My answer is only a workaround and i hope someone knows a better solution to my problem. – Michael Sep 28 '21 at 07:18
  • @Michael your answer also contains a (new?) question, this doesn't make it a good answer. If the workaround you found solves your problem, then have the answer contain only that part, and ask a new question with the rest of the answer, if indeed it deserves a new question. – Cristik Sep 28 '21 at 10:42
  • ok, thanks. changed my answer and removed the additional question. But help me please: In my opinion I don't want to ask a new question only make clear that my answer is only a workaround. Can't I do this that way? (Sorry if this is a beginner question in using stack overflow) ;-) – Michael Sep 28 '21 at 16:11
0

The error disappears with Beta 3 of iOS15.1

Michael
  • 616
  • 5
  • 20