Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vision Framework providing inexact roll and yaw values

Tags:

ios

swift

I'm using Vision Framework to try and get the roll and yaw of a face.

I'm using a VNSequenceRequestHandler on my CVPixelBuffer and am able to use both VNDetectFaceLandmarksRequest and/or VNDetectFaceRectanglesRequest to successfully get back the faces including landmarks (for the landmark request). So far so good.

However, when I try and get the roll and yaw values, I'm getting them as one a discrete set of values rather than a continuous range of values reflecting the exact orientation of the face.

The iOS docs for roll and yaw state that:

The roll/yaw is reported in radians. A positive angle corresponds to counterclockwise roll. The range is [-Pi, Pi). A nil value indicates that the roll/yaw angle hasn't been computed.

However, when I look at the value, whilst roll is clearly being computed, I'm only getting discrete values, i.e. as my face rotates from right way up to upside-down, I get:

0 - face is upright

0.524 (Pi/6) - face starts rotating

1.047

1.571 (Pi/2) - face is now landscape

2.094

2.618

-3.142 (-Pi) - face is now upside-down

In other words, it seems there are only 12 possible roll values.

Surely this is not correct?

yaw is even worse, I only get 0.785 and -0.785 in either direction.

like image 514
Jonathan Ellis Avatar asked Oct 26 '25 08:10

Jonathan Ellis


1 Answers

Apple have now confirmed that this is in fact the designed behaviour: https://forums.developer.apple.com/thread/113601

The yaw and roll properties of a VNFaceObservation return a limited, discrete set of values, not a continuous range.

If you would like a higher degree of precision in these values, you should file an enhancement request!

like image 99
Jonathan Ellis Avatar answered Oct 28 '25 23:10

Jonathan Ellis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!