Created
June 15, 2018 16:05
-
-
Save onmyway133/6faf7b625d4a4b5ff11773473d1fcaec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let handler = VNImageRequestHandler( | |
cgImage: cgImage, | |
orientation: inferOrientation(image: image), | |
options: [VNImageOption: Any]() | |
) | |
let request = VNDetectTextRectanglesRequest(completionHandler: { [weak self] request, error in | |
DispatchQueue.main.async { | |
self?.handle(image: image, request: request, error: error) | |
} | |
}) | |
request.reportCharacterBoxes = true | |
do { | |
try handler.perform([request]) | |
} catch { | |
print(error as Any) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment