Head tracking fun

post's picture

Here's a little thing to impress your friends. It's based off _dust_s HaarKit composition.

My question is: I would love to add depth to the head tracking. How do I get depth information from the Apply Haar Cascade or Optical Flow Points patches?

If I can get a scaling rectangle for the tracked face, I can infer the z axis, and really improve this.


headTracker_w_skybox.zip9.86 MB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

okbye's picture
Re: Head tracking fun

You can get depth information with CV. Simply get two points and calculate the distance.

dust's picture
Re: Head tracking fun

wow that works real good with the new cv tools. running the haar through the optical flow was more or less a dirty patch to the defunct haar patch of old cv tools but that works real well like i said with the new cv tools.

post's picture
Re: Head tracking fun

Hiya dust --

I've been through all the QC head trackers, and your implementation -- dirty patch or not is hands down the only one that really does the job :-)

This is what I'm after... http://www.youtube.com/watch?v=Jd3-eiid-Uw#t=2m57s

So, any ideas on getting the depth axis?

All the best -SW

Gutterkisser's picture
Re: Head tracking fun

Not sure if this helps, but over the past week I've been experimenting with head tracking in QC using a Wii Remote. Same basic idea as Johnny Lee's video you posted.

With the Wii Remote, the Z Axis (depth) needs to be calculated from the X and Y positions of 2 infrared lights (the sensor bar), as the raw IR data of the Wii Remote doesn't measure a Z value.

Basically, the calculation seems to be:

sqrt((Y2-Y1)^2 + (X1-X2)^2)

There's some additional calculations to scale that data, but that's the backbone of the depth axis.

I couldn't view your file so I have no idea if this helps - but I've attached a .qtz showing what I mean (the part in red notation is the Z Axis calc). This uses the Kineme WiiMote Control patch, of course.

Btw, all credit to Keith Lang for that Z Axis calc (http://www.pixelcorps.tv/macbreak161) - it was the final piece in the puzzle that my shaky maths couldn't quite slot into place.

Wii Remote Head Tracking.zip10.86 KB