From Google Play Services 7.8 Face Detection include in Mobile Vision API. It helps to Detect and track faces from Live Camera or Video.
1. add google gms service dependencies to gradle file.
compile 'com.google.android.gms:play-services:7.8.+'
2. Add meta info to Manifest file.
<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="face"/>
3. Create FaceDetector Instance.
FaceDetector detector = new FaceDetector.Builder(this)
.build();
4. get Faces in Array.
Frame frame = new Frame.Builder().setBitmap(bitmap).build();
SparseArray<Face> faces = detector.detect(frame);
now you can get any face info from Face's SparseArray.
Happy Coding :)
0 Comment(s)