Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Get which points identify mouth and eyes. #13

Closed
Neogene opened this issue Apr 28, 2014 · 7 comments
Closed

Get which points identify mouth and eyes. #13

Neogene opened this issue Apr 28, 2014 · 7 comments

Comments

@Neogene
Copy link

Neogene commented Apr 28, 2014

The face tracking works really flawlessly but how can we detect which are the points that compose the eyes and the mouth? They are the ones inside the face shape perimeter but there is a way to get them precisely to define three polygons to create a mask (i'm trying to use the face to create a mask to apply to a texture to avoid the texture cover the eyes and the mouth area). thanx in advance. The idea is to fill the face area without filling the eyes and mouth polygons to generate the mask to be applied to a texture centered to the nose of the human.

@kylemcdonald
Copy link
Owner

tracker.getImageFeature(ofxFaceTracker::LEFT_EYE);
tracker.getImageFeature(ofxFaceTracker::RIGHT_EYE);
tracker.getImageFeature(ofxFaceTracker::OUTER_MOUTH);
tracker.getImageFeature(ofxFaceTracker::INNER_MOUTH);

these return polylines for the features you're interested in.

@Neogene
Copy link
Author

Neogene commented Apr 28, 2014

Thank you, but this is for openframeworks not for the FaceTracker OpenCV plain (only c++) project.

@kylemcdonald
Copy link
Owner

sorry! i thought we were talking ofxFaceTracker :)

that said, ofxFaceTracker is a good reference for how to get this kind of data.

inner mouth: {48,60,61,62,54,63,64,65}
outer mouth: consecutive(48, 60)
left eye: consecutive(36, 42)
right eye: consecutive(42, 48)

and the place you're looking is:

const Mat& shape = tracker._shape;
int n = shape.rows / 2;
shape.db(i, 0), shape.db(i + n, 0)

@Neogene
Copy link
Author

Neogene commented Apr 30, 2014

Thank you, for others users in need i'm listing here all the points intervals:

face: consecutive (0,16)
left eyelash: consecutive(17,21)
right eyelash: consecutive(22,26)
nose: consecutive(27,30) (33 may be counted too)
nostrils: consecutive(31,35) (may be splitted in 31&32 for left, 34&35 for right and 33 for center)
left eye: consecutive(36, 42)
right eye: consecutive(42, 48)
inner mouth: {48,60,61,62,54,63,64,65}
outer mouth: consecutive(48, 60)

@kylemcdonald
Copy link
Owner

next time i need to refactor ofxFaceTracker, i will try to move extra API features like this into FaceTracker directly.

@Neogene
Copy link
Author

Neogene commented Apr 30, 2014

Yes, a nice addition would be to add/enable full face shape detection, including the forehead, i've seen this in other samples around the web, the only way for now i've found is to shift upward (ok i know it's really a crap way) the eyelash points to simulate the forehead area.

@mosspassion
Copy link

@Neogene How did you raise the eyelash points higher? I want a forehead mask too, and I'm trying to get ride of the eyes and mouth hole.

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

No branches or pull requests

3 participants