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

SOLVED: No faces found on image, solution by @aznxed #53

Open
javierfurus opened this issue Apr 13, 2019 · 1 comment
Open

SOLVED: No faces found on image, solution by @aznxed #53

javierfurus opened this issue Apr 13, 2019 · 1 comment

Comments

@javierfurus
Copy link

javierfurus commented Apr 13, 2019

If faces are not detected, try this solution by @aznxed. The issue is that face are only detected when you take a picture in landscape mode which makes the usability of the app - and the code we learn - very limited, outright broken. This solution rotates the portrait images so that they are usable and face detection works as intended.

    Try this in addition to line 73 in BitmapUtils.java, tested in portrait mode on Google Pixel 2

    Matrix matrix = new Matrix();
    matrix.postRotate(-90);

    Bitmap bitmapOrg = BitmapFactory.decodeFile(imagePath);
    Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmapOrg, bitmapOrg.getWidth(), bitmapOrg.getHeight(), true);
    Bitmap rotatedBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix, true);

    return rotatedBitmap;

Originally posted by @aznxed in #1 (comment)

@javierfurus javierfurus changed the title SOLVED: No faces found on image, solution by @aznexed SOLVED: No faces found on image, solution by @aznxed Apr 13, 2019
@LidorPrototype
Copy link

I tried this solution and it still wont recognize my face in portrait mode, I'm using samsung galaxy s10+

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