Hello
How can i crop and save faces from face detect ?
My code
How can i crop and save faces from face detect ?
My code
Face Detection:
cvs.ClearRect(cvs.TargetRect)
Dim frameBuilder As JavaObject
Dim bb As JavaObject
bb = bb.InitializeStatic("java.nio.ByteBuffer").RunMethod("wrap", Array(data))
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
Dim cs As CameraSize = camEx.GetPreviewSize
frameBuilder.RunMethod("setImageData", Array(bb, cs.Width, cs.Height, 842094169))
Dim frame As JavaObject = frameBuilder.RunMethod("build", Null)
Dim SparseArrayFace As JavaObject = facedetector.RunMethod("detect", Array(frame))
LastPreview = DateTime.Now
Dim MatchesFaces As Int = SparseArrayFace.RunMethod("size", Null)
For i = 0 To MatchesFaces - 1
Dim face As JavaObject = SparseArrayFace.RunMethod("valueAt", Array(i))
'How can i crop and save faces as image file.
Next
Last edited: