1 | initial version |
Hello.
Good luck with this, it is a challenge.
Firstly, your secondary issue. You could use background subtraction to mask areas where you do not want to detect features. Or use face detect to get a rectangle, and shrink the rectangle so only face features are found. Alternatively, use an active appearance model or constrained local model to get actual facial feature points.
"[the features] are unprojected and intersected with the virtual cylinder. Exact solution to this ray-cylinder intersection could easily be found on the net.
This is all camera pose guff. The main problem is the language used to describe this stuff. Anyway, you have 3D points in model space. You need to apply the rotation and translation to a model cylinder, this will align the cylinder with the points you detected and the poses that you found. R and T matrices, which form the P matrix for projections.
I recommend doing a tutorial on OpenGL so that you can see more clearly how R and T, which are decomposed from P work together. Then this stuff becomes much more straight forward. Don't get hung up on the shapes, it's all about the MVP!!!
Essentially, he has a 3D model. Using the poses that you have calculated, you can align that model into the image. If it was not a cylinder, you could use three arrows (r,b,g).
Here is another good one, the guys on this site are very good with the code available on github
http://www.morethantechnical.com/2010/03/19/quick-and-easy-head-pose-estimation-with-opencv-w-code/
Or if the ray cylinder is the way you need to go.
http://stackoverflow.com/questions/4078401/trying-to-optimize-line-vs-cylinder-intersection