Skip to content

Instantly share code, notes, and snippets.

@jbadger3
Created June 12, 2020 04:42
Show Gist options
  • Save jbadger3/46b27ce416b28fffbe809adf19f27661 to your computer and use it in GitHub Desktop.
Save jbadger3/46b27ce416b28fffbe809adf19f27661 to your computer and use it in GitHub Desktop.
func completedVisionRequest(_ request: VNRequest?, error: Error?) {
// Only proceed if a rectangular image was detected.
guard let rectangles = request?.results as? [VNRectangleObservation] else {
guard let error = error else { return }
print("Error: Rectangle detection failed - Vision request returned an error. \(error.localizedDescription)")
return
}
// do stuff with your rectangles
for rectangle in rectangles {
print(rectangle.boundingBox)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment