Android Question Face Detect


Active Member
Licensed User
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?

Private Sub GetMidPoint(Face As JavaObject) As Float()
    Dim vl(3) As Float
    Dim p As JavaObject
    p.InitializeNewInstance("", 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
    mbmp = jo.RunMethod("createBitmap", Array As Object(Width, Height, "RGB_565"))
    Dim ar, Face As JavaObject
    faces = ar.RunMethod("newInstance", Array As Object(Face, MaxNumberOfFaces))
    faceDetector.InitializeNewInstance("", 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


Active Member
Licensed User
I added the methods below in the GetMidPoint
and I obtained the following resuiltado.
confidence factor ok ... returned 0.5115 ....
but pose always returns 0.0.
can it be my cell that does not support this function ???
I'll try another one.

ToastMessageShow(Face.RunMethod("confidence", Null),False)
Dim Euler_X = 0, Euler_Y = 1, Euler_Z = 2 As Int
ToastMessageShow(Face.RunMethod("pose", Array As Object(Euler_Y)), False)