Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf Guidelines #96

Closed
transitive-bullshit opened this issue Aug 10, 2014 · 4 comments

Comments

@transitive-bullshit
Copy link

commented Aug 10, 2014

I'm trying to use tracking.js with getUserMedia and a face object tracker and am experiencing unusable framerates.

The source video is 640x480, and I'm using the following tracker options:

      tracker.setInitialScale(4)
      tracker.setStepSize(2)
      tracker.setEdgesDensity(0.1)

My question is: can any of the tracker options be used to affect perf vs accuracy, or is the largest factor affecting perf the size of the source video?

@eduardolundgren

This comment has been minimized.

Copy link
Owner

commented Aug 10, 2014

Those options can improve performance, specially the step size and initial scale. ViolaJones is a good object detection algorithm, although for large images 640x480 it can reach low frame rates.

Two features from our roadmap that will speed up performance for cases like that:
1- Create some sort of ThreadableTracker abstract class that splits process into different Workers.
2- Use optical flow to predict the movement in order to not require processing every frame using ViolaJones.

A workaround for now is to write the 640x480 video into a smaller hidden canvas, and this canvas is the element being track, when track event fires with rectangles you can proportionally projects the coordinates into the larger visible video.

@transitive-bullshit

This comment has been minimized.

Copy link
Author

commented Aug 11, 2014

Thanks for the quick response. For now, I'm going with the intermediate canvas approach 👍

@eduardolundgren

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2014

Sounds good, closing this for now.

@eduardolundgren

This comment has been minimized.

Copy link
Owner

commented Aug 12, 2014

Relates to #99.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.