Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to select only lip's landmarks #16

Closed
nimesh7424 opened this issue Jul 16, 2018 · 6 comments
Closed

How to select only lip's landmarks #16

nimesh7424 opened this issue Jul 16, 2018 · 6 comments

Comments

@nimesh7424
Copy link

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
Copy link

kartk commented Jul 18, 2018

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
Copy link
Author

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
Copy link

kartk commented Jul 18, 2018

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
Copy link
Author

nimesh7424 commented Jul 18, 2018

Thank you it works in images.

@kartk
Copy link

kartk commented Jul 18, 2018

In OnGetImageListener.java, onImageAvailable function

@nimesh7424
Copy link
Author

nimesh7424 commented Jul 18, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants