Last active
April 22, 2016 14:20
-
-
Save electrolobzik/c4e58f4850c9d74b329cad7e241ca924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Factory for creating a face tracker to be associated with a new face. The multiprocessor | |
* uses this factory to create face trackers as needed -- one for each individual. | |
*/ | |
private class GraphicFaceTrackerFactory implements MultiProcessor.Factory<Face> { | |
@Override | |
public Tracker<Face> create(Face face) { | |
return FaceTracker.builder() | |
.withCameraType(CameraType.FrontCamera) | |
.withPreviewWidth(cameraSource.getPreviewSize().getHeight()) | |
.withPreviewHeight(cameraSource.getPreviewSize().getWidth()) | |
.withPictureWidth(cameraSource.getPictureSize().getWidth()) | |
.withPreviewViewWidth(cameraSourcePreview.getWidth()) | |
.withPreviewViewHeight(cameraSourcePreview.getHeight()) | |
.withFrame(selfieFrameImg.getLeft(), centralLayout.getTop(), selfieFrameImg.getRight(), centralLayout.getBottom()) | |
.withListener(new TestFaceTrackerListener()) | |
.withTrackingLoggingEnabled(graphicOverlay) | |
.build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment