VNTrackRectangleRequest outputs inaccurate bounding box result when tracking manually created VNRectangleObservations

Originator:hfriia
Number:rdar://47257846 Date Originated:1/14/2019
Status:Open Resolved:
Product:Vision.framework Product Version:12.1.2 (16C104)
Classification:Serious Bug Reproducible:Always
 
Area:
Vision.framework

Summary:
When running a VNTrackRectangleRequest on a VNRectangleObservation that has been manually created (using one of the provided initializers), the VNRectangleObservation output from the tracking request has an incorrect bounding box.

I've attached a slightly modified version of the sample code TrackingMultipleObjectsOrRectanglesInVideo, found here: https://developer.apple.com/documentation/vision/tracking_multiple_objects_or_rectangles_in_video

My changes can be found on line 68 of VisionTrackerProcessor.swift.

Steps to Reproduce:
Create a rectangle observation: VNRectangleObservation(boundingBox: myCustomBoundingBox)
Creating a VNTrackRectangleRequest with the rectangle observation
Observe the bounding box property of the VNRectangleObservation output when the tracking request has completed.

Expected Results:
The tracking request is able to accurately track a given rectangle across several frame.

Actual Results:
The tracking request outputs an incorrect bounding box, and therefore is not able to track the next frame with that previous output.

Here is the debugger output of a rectangle observation before being fed into a tracking request, and then the rectangle observation that is returned as the output of that tracking request:

<VNRectangleObservation: 0x280ca55f0> 08D44526-469F-4CA0-929D-6C69ABC29180, revision 1, 1.000000 [0.308167 0.377704 0.375584 0.215798]

<VNRectangleObservation: 0x280ca4b40> 08D44526-469F-4CA0-929D-6C69ABC29180, revision 1, 1.000000 [0.0125 0.0125 0 0]

You can see that the UUID is the same, but the bounding box changes to a completely incorrect [0.0125 0.0125 0 0].

Version/Build:
Xcode Version 10.1 (10B61)
Deployment Target 12.0

Configuration:
iPhone 7
iOS 12.1.2 (16C104)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!