Last active
July 12, 2018 16:36
-
-
Save elvismetaphor/0814f94d80295ec3ac8ec98a9fdd6512 to your computer and use it in GitHub Desktop.
Add on-device text recognition (iOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy var textDetector: VisionTextDetector = Vision.vision().textDetector() | |
func runTextRecognition(with image: UIImage) { | |
let visionImage = VisionImage(image: image) | |
textDetector.detect(in: visionImage) { (features, error) in | |
if let error = error { | |
print("Received error: \(error)") | |
} | |
self.processResult(from: features, error: error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment