Created
May 26, 2021 04:34
-
-
Save anupamchugh/e348b48f741c6968b58d7c14b0ff8426 to your computer and use it in GitHub Desktop.
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
func createVisionRequest(image: UIImage){ | |
currentImage = image | |
guard let cgImage = image.cgImage else { | |
return | |
} | |
let requestHandler = VNImageRequestHandler(cgImage: cgImage, orientation: image.cgImageOrientation, options: [:]) | |
let vnRequests = [vnTextDetectionRequest] | |
DispatchQueue.global(qos: .background).async { | |
do{ | |
try requestHandler.perform(vnRequests) | |
}catch let error as NSError { | |
print("Error in performing Image request: \(error)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment