I need to crop UIImage from recognized VNRecognizedObjectObservation and Turi Create coordinates.
I've tried a lot of ways cropping images but nothing works well.
Stack Overflow question with images
I've tried a lot of ways cropping images but nothing works well.
Stack Overflow question with images
Code Block func handleClassifications(request: VNRequest, error: Error?) { DispatchQueue.main.async { [weak self] in guard let self = self, let predictions = request.results as? [VNRecognizedObjectObservation] else { return } let objectBounds = VNImageRectForNormalizedRect(predictions.first!.boundingBox, Int(self.bufferSize.width), Int(self.bufferSize.height)) let img = self.chosenImage!.cropped(rect: objectBounds) self.recognitionImageView.image = img } }