auduno / headtrackr

Javascript library for headtracking via webcam and WebRTC/getUserMedia
3.69k stars 504 forks source link

Webworker #12

Open jorgenskogmo opened 11 years ago

jorgenskogmo commented 11 years ago

Hei Audun,

I was thinking, could a webworker version of the (sweet!) headtracker improve performance?

j.

auduno commented 11 years ago

Hi,

that depends on what performance you're thinking of, how well it tracks faces or how fast it is?

It would maybe be possible to speed up tracking with web workers. I never tried implementing headtrackr for web workers, since it usually is not trivial to make the code parallelizable, and I don't have any experience with that kind of work.

When it comes to how well it manages to track faces, web workers wouldn't make a difference. To make it any better, I'd have to change the algorithm, and I haven't found any better algorithms that are fast and easy to implement so far.

-Audun

jorgenskogmo commented 11 years ago

Hi,

Yes, it was the "speed up tracking with web workers" approach I was thinking about. Will fiddle a bit ;-)

auduno commented 11 years ago

You're welcome! :) Just let me know if you have some questions, I don't know how easy the code is to understand always.

sohaiba commented 9 years ago

Hi Jørgen and Audun, We are currently using the head tracker as part of a real time application which requires displaying time-sensitive images alongside head tracking. Although we are using timers to display these images, it seems to us that the head tracker execution is prioritized due to the single threaded nature of JavaScript, resulting in delays of fifty milliseconds more than the desired time interval for each image display. We cannot afford that kind of delay associated with timers so we are considering the use of web workers to help us achieve an illusion of multi threading and thus reduce these time delays. Please let us know how successful your use of web workers with the head tracker was, what problems you had to overcome and if it helped you achieve what you wanted to do. If possible, please also suggest how we can achieve our goal using web workers with head tracker. Thank you.