title: Improving the accuracy of text recognition when using iOS Vision Framework to scan a document
body: <p>I am trying to build a document scanner that is able to read text off of any document/card. However, it sometimes has trouble identifying text correctly off of a credit card. The accuracy is decent, but there is definitely room for improvement. I used the VisionTextRecognition framework and have used all the standard settings which are the right ones for setting up text recognition.</p>
  <p>This is what I had to setup the text recognition request</p>
  <pre><code>textRecognitionRequest = VNRecognizeTextRequest(completionHandler: { (request, error) in
              if let results = request.results, !results.isEmpty {
                  if let requestResults = request.results as? [VNRecognizedTextObservation] {
                      var foundText = &quot;&quot;
                      for observation in recognizedText {
                          guard let candidate = observation.topCandidates(1).first else { continue }
                       foundText.append(candidate.string + &quot;\n&quot;)
                      }
                  }
              }
          }) 
          textRecognitionRequest.recognitionLevel = .accurate
          textRecognitionRequest.usesLanguageCorrection = true
  </code></pre>
  <p>Does anyone have any suggestions for improving the identification programmatically by either pre-processing or post-processing the scan at some point?</p>