How to get corresponding pixel from Object Detection

Hey guys!

I'm building an app which detects cars via Vision and then retrieves the distance to said car by a synchronized depthDataMap. However, I'm having trouble finding the correct corresponding pixel in that depthDataMap. While the CGRect of the ObjectObservation ranges from 0 - 300 (x) and 0 - 600 (y), The width x height of the DepthDataMap is Only 320 x 180, so I can't get the right corresponding pixel. Any Idea on how to solve this?

Kind regards

Hello,

VNDetectedObjectObservation returns its results as a normalized bounding box, that doesn't seem to align with what you've stated here:

While the CGRect of the ObjectObservation ranges from 0 - 300 (x) and 0 - 600 (y)

Can you provide a focused sample project that demonstrates this?

How to get corresponding pixel from Object Detection
 
 
Q