Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FaceDetector faceDetector = new
- FaceDetector.Builder(getApplicationContext()).setTrackingEnabled(true)
- .build();
- if(!faceDetector.isOperational()){
- new AlertDialog.Builder(getApplicationContext()).setMessage("Could not set up the face detector!").show();
- return;
- }
- Frame frame = new Frame.Builder().setBitmap(photo).build();
- faces = faceDetector.detect(frame);
- System.out.println("iiii"+faces.get(1));
- for(int i=0; i<faces.size(); i++) {
- Face thisFace = faces.valueAt(i);
- Float x1=new Float(0);
- x1 = thisFace.getPosition().x;
- float y1 = thisFace.getPosition().y;
- float x2 = x1 + thisFace.getWidth();
- float y2 = y1 + thisFace.getHeight();
- //tempCanvas.drawCircle(x1,y1,1,myRectPaint);
- tempCanvas.drawRoundRect(new RectF(x1, y1, x2, y2), 1, 1, myRectPaint);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement