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

Use Google Vision API w/ Fotoapparat #15

Open
koenschauwaert opened this issue Dec 21, 2017 · 1 comment
Open

Use Google Vision API w/ Fotoapparat #15

koenschauwaert opened this issue Dec 21, 2017 · 1 comment

Comments

@koenschauwaert
Copy link

I want to use Fotoapparat in combination with the Google Vision API and work with landmarks to detect faces, eyes, nose and mouth; like this:

Landmarks on faces

The Fotoapparat FaceDetector only shows a square around faces.

Can I use your library together with Google's API? If so: how?

@ghost
Copy link

ghost commented Jan 12, 2018

The Fotoapparat FaceDetector uses class FaceDetector(a class in library) to do face detection actually. The FaceDetector.detectFaces will return the detected faces location. You can use below code to do this:

FaceDetector mFaceDetector = FaceDetector.create(context);
List<Rectangle> detectedFaceAreas = mFaceDetector.detectFaces(nv21Image, width, height, 0);

Now you get the location of detected faces. And then you can use Google Vision API to detect the face item location. Lastly, just draw the face with rectangle and face item with number on your app(in bitmap or overlay).

Note: The nv21Image is the byte array stores the image nv21 format data.

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

1 participant