I'm trying to get a the Euler angle of a Face that is detected by FaceDetector.
Here is what I use to output to Logcat:
Log.v("debug", " X: " + face.pose(Face.EULER_X) + " Y: " + face.pose(Face.EULER_Y) + " Z: " + face.pose(Face.EULER_Z) );
But it always returns 0.0 for all three, no matter what angle the face is at. Any ideas why?
Yeah the FaceDetector from API 1 never returns a pose angle. You can look at the source code to verify.
The newer FaceDetectionListener from API 14 will return a pose angle, but it's only available on a limited number of devices right now. Not even all devices running API 14 can use it. You have to call getMaxNumDetectedFaces() to see if your device supports that API.
You can alternately try using OpenCV. A couple options for that are http://code.opencv.org/projects/opencv/wiki/OpenCV4Android and http://code.google.com/p/javacv/. In my experience they aren't worth the hassle unless you really, really need the pose angle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With