I am exploring android vision api and following the github samples provided in android developers documentation.The sample application is detecting the faces.
I want to crop each of the detected faces. I have a rect obj having left,top,right,bottom coordinates.
But I lack the source Bitmap to crop the face.
Things I have done:
1.Tried using the custom detector given in this SOF post
Here myFaceDetector's SparseArray detect(Frame frame) method is getting called repeatedly and it is not detecting the face.The Processor set is not getting called. I used the below code
FaceDetector detector = new FaceDetector.Builder(context)
.setClassificationType(FaceDetector.ALL_CLASSIFICATIONS)
.build();
MyFaceDetector myFaceDetector = new MyFaceDetector(detector);
myFaceDetector.setProcessor(new MultiProcessor.Builder<>(new GraphicFaceTrackerFactory())
.build());
mCameraSource = new CameraSource.Builder(context, myFaceDetector)
.setRequestedPreviewSize(640, 480)
.setFacing(CameraSource.CAMERA_FACING_FRONT)
.setRequestedFps(2.0f)
.build();
The GraphicFaceTrackerFactory() is not getting called after the camera preview started.
2.Tried to take the camera picture as source bitmap but struck in taking pictures continuously.
Any help will be very useful.thanks in advance.