VNRecognizeTextRequest iOS 15 problem recognizing text

1.7k Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

The error disappears with Beta 3 of iOS15.1

5
On

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"