I am using the subroutines below to detect the faces of the image.
This is working perfectly.
I would like some help getting Euler_x, Euler_Y and Euler_Z.
Can someone help me?
This is working perfectly.
I would like some help getting Euler_x, Euler_Y and Euler_Z.
Can someone help me?
B4X:
Private Sub GetMidPoint(Face As JavaObject) As Float()
Dim vl(3) As Float
Dim p As JavaObject
p.InitializeNewInstance("android.graphics.PointF", Null)
Face.RunMethod("getMidPoint", Array As Object(p))
vl(0) = p.GetField("x")
vl(1) = p.GetField("y")
vl(2) = Face.RunMethod("eyesDistance", Null)
Return vl
End Sub
Private Sub PrepareFaceDetection(Width As Int, Height As Int, MaxNumberOfFaces As Int)
Dim jo As JavaObject
jo.InitializeStatic("android.graphics.Bitmap")
mbmp = jo.RunMethod("createBitmap", Array As Object(Width, Height, "RGB_565"))
Dim ar, Face As JavaObject
ar.InitializeStatic("java.lang.reflect.Array")
Face.InitializeStatic("android.media.FaceDetector$Face")
faces = ar.RunMethod("newInstance", Array As Object(Face, MaxNumberOfFaces))
faceDetector.InitializeNewInstance("android.media.FaceDetector", Array As Object(Width, Height, MaxNumberOfFaces))
End Sub
Sub FindFaces(bmp As Bitmap) As Int
Dim destRect As Rect
destRect.Initialize(0, 0, mbmp.Width, mbmp.Height)
cvs.DrawBitmap(bmp, Null, destRect)
Return faceDetector.RunMethod("findFaces", Array As Object(mbmp, faces))
End Sub