gicheonkang / fast-face-android

👦 Fast-Face : Android App for Real-time Face Landmark Detection. You can check your landmarks in 60ms
Apache License 2.0
381 stars 127 forks source link

How to select only lip's landmarks #16

Closed nimesh7424 closed 6 years ago

nimesh7424 commented 6 years ago

I am developing makeup app in android so I want to ask that how do i select only lip's landmark and fill color inside like(Lipstick)

kartk commented 6 years ago

See the 68 Point landmarks picture in the following link : https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/

As seen from the pic, lips landmarks are from 49 - 68

nimesh7424 commented 6 years ago

yes you are right. Actualy I did this but in this library they are not providing a method by which i can get index of particular landmark. As below code i am not able to get landmark 49 to 68.

if (results.size() != 0) { for (final VisionDetRet ret : results) { float resizeRatio = 4.5f; Canvas canvas = new Canvas(mInversedBipmap);

    // Draw landmark
    ArrayList<Point> landmarks = ret.getFaceLandmarks();
    for (Point point : landmarks) {
        int pointX = (int) (point.x * resizeRatio);
        int pointY = (int) (point.y * resizeRatio);
        canvas.drawCircle(pointX, pointY, 4, mFaceLandmardkPaint);
    }
 }

}

kartk commented 6 years ago

May be not the best way but this works :

int counter = 0 ;
ArrayList<Point> landmarks = ret.getFaceLandmarks();
    for (Point point : landmarks) {
       if( counter >= 48) {
           int pointX = (int) (point.x * resizeRatio);
           int pointY = (int) (point.y * resizeRatio);
           canvas.drawCircle(pointX, pointY, 4, mFaceLandmardkPaint);
       }
       counter++ ;
    }
 }
nimesh7424 commented 6 years ago

Thank you it works in images.

kartk commented 6 years ago

In OnGetImageListener.java, onImageAvailable function

nimesh7424 commented 6 years ago

yes i got it

thank you

On Wed, Jul 18, 2018 at 12:54 PM, Karthik govindappa < notifications@github.com> wrote:

In OnGetImageListener.java, onImageAvailable function

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gicheonkang/fast-face-android/issues/16#issuecomment-405835676, or mute the thread https://github.com/notifications/unsubscribe-auth/AXRd5g6zV1vaStE9MAzCpPno5olMoSr8ks5uHuKTgaJpZM4VQmgK .