Closed prometuse closed 9 years ago
I think that the information about Face Pitch, Face Yaw and Face Roll are on the vector "FaceTracker ->_clm._pglbl". The first one ( at
Thank you very much! I tried to print out content of (4,0) and (5,0). They are probably the coordinate of head on the 2d image plane. What I need is the 3D position including the depth info of face w.r.t camera. Hope somebody could give me a hint?
Well, to get the head position in an opencv type vector
const Mat& mean = faceTracker->_clm._pdm._M;
const Mat& variation = faceTracker->_clm._pdm._V;
const Mat& weights = faceTracker->_clm._plocal;
vector<Point3f> face3DPoints = mean + variation * weights;
With this code you get the facial points in 3d. That is what you want?
@jovanoasis Thanks very much again! The code you offered is very helpful, but it seems to be the coordinate of a 3D distribution model relative to the head because the coord didn`t change when I move my head relative to the camera. So what I actually want is the depth info of head, usually obtained by a kinect.
for more examples of using data from inside FaceTracker, check out https://github.com/kylemcdonald/ofxFaceTracker/blob/master/src/ofxFaceTracker.cpp
to get 3d position, you have a projective version here:
https://github.com/kylemcdonald/ofxFaceTracker/blob/master/src/ofxFaceTracker.cpp#L247-L250 https://github.com/kylemcdonald/ofxFaceTracker/blob/master/src/ofxFaceTracker.cpp#L253-L256
these tell you 2d position and scale. from there you can convert to 3d position if you have a model of the camera intrinsics.
Hello, I am new to facetracker. I am recently doing a project to do gaze estimation, and I am using facetracker. I need the infomation of 3D head position w.r.t the camera, is Facetracker offering that? Thank you very much !