ashok
ashok

Reputation: 9

how can we convert FaceDetector.Face to bitmap image in android?

in my application i have 2 images(ex:2 persons photos),

one background image is there one foreground image is there. now i want to cut face part from foreground image and attach that face to background image and finally i want to generate final image contain background image body and foreground image face.

Could you please help me..

Thanks in advance

Upvotes: 0

Views: 1855

Answers (1)

Reno
Reno

Reputation: 33792

how can we convert FaceDetector.Face to bitmap image in android

The algorithm will be sort of like this :

  • Get the mid points of all the faces in the Image, whose confidence is > 0.4
  • Roughly calculate a rect around the face which is about the dimensions shown in the image; the distance between the eyes is A . If you can get an oval shape proportional to the eye distance, it is even better.
  • Crop the image from the coordinates you've just calculated

............................               cute isn't she :D

Note: you have to take care of the Euler angles too, if the face is tilted.

Upvotes: 3

Related Questions