Apply smile effect to face image in android application

33 Views Asked by At

I am developing an android application which performs various operations on face image.

One of the feature is to apply smile effect on face using seekbar.

I am detecting the face using Dlib library which gives me the lips area points. Below is the reference.

Reference image dlib

Here is the code to detect lips using Dlib library.

final String targetPath = getFilesDir().getAbsolutePath() + File.separator + "shape_predictor_68_face_landmarks.dat";
if (!new File(targetPath).exists()) 
{
    FileUtils.copyFileFromRawToOthers(getApplicationContext(), R.raw.shape_predictor_68_face_landmarks, targetPath);
}

FaceDet faceDet = new FaceDet(targetPath);
List<VisionDetRet> faceList = faceDet.detect(inputBitmap);

if (faceList.size() > 0)
{
    face = faceList.get(0);

    ArrayList<Point> facePointList = face.getFaceLandmarks();
    lipStartX = facePointList.get(48).x;
    lipStartY = facePointList.get(48).y;
    lipEndX = facePointList.get(54).x;
    lipEndY = facePointList.get(54).y;
}

After detecting the lips area I am unable to figure out how to apply smile effect and also modify it using seekbar. I tried with openCV library but it did not work for me.

This is an original image below.

normal image

Below is the result I want.

result image

I want to know how can I achieve this result in android.

If anyone can help me or give me some guidance, it will be really helpful for me.

0

There are 0 best solutions below