Code example for FaceDetector

Methods: findFaces

0
    // ----------------------------------------------------- 
    private Face faceDetect(Bitmap bmp)
    { 
         
        FaceDetector.Face[] faces = new FaceDetector.Face[1]; // 結果受け取り用
        FaceDetector detector = new FaceDetector(bmp.getWidth(), bmp.getHeight(), faces.length);
        int numFaces = detector.findFaces(bmp, faces); // 顔認識実行
        if (numFaces > 0) {
            Face face = faces[0];
            return face;
        } else { 
            return null; 
        } 
    } 
     
    // ----------------------------------------------------- 
    // Native Code 
    // ----------------------------------------------------- 
    public native void NativeBitmapFunc(Bitmap bmp);
     
    public native void HairExtraction(Bitmap bmp, float x, float y, float w);