Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D head tracking on iphone

I want to make an augmented reality application for trying glasses on iphone.

To do that i need 3D head tracking ( providing X,Y,Z position and orientation ).
someting like this FaceApi but for iphone.

Can anyone propose me a solution to perform this type of tracking on iphone?

like image 768
Hamila Mohamed Amine Avatar asked Jun 30 '11 10:06

Hamila Mohamed Amine


2 Answers

I'd recommend using OpenCV, which is a computer vision library. Searching online for how to detect faces using OpenCV will return a plethora of links, as it is a very common use of this library.

Here's a link relating to getting it to compile on the iPhone.

like image 157
bitgarden Avatar answered Oct 30 '22 00:10

bitgarden


Yes, you can do this easily with OpenCV's built-in Haar classifiers, and you'll find a lot of demos and tutorials online for that. You don't need to find the Z position, just the face size. More important to you will be eye position - and there are Haar classifiers for that too. You can find a face region, and then find the eye regions within that region, and you'll have a very good basis for positioning your eyeglass overlay on the subject. There are lots of tweaks to speed up the process, like downsampling and telling the classifier to search for only one face. Good luck.

like image 45
Matt Montag Avatar answered Oct 30 '22 02:10

Matt Montag