eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.43k stars 1.44k forks source link

tracking event listener #293

Open peterlunglum opened 6 years ago

peterlunglum commented 6 years ago

Is there a way to slow or reduce the number of times 'tracker.on' track would listen and update the amount of data or objects being detected? When objects are relatively still, it will still update the data integer very quickly and I'd like to check for objects less frequently.

alexandermaisey commented 6 years ago

If you are using an HTML5 video object, you can overwrite the framerate property of getUserMedia. By default, it is 30fps. I have it at 10fps so motion still looks ok but tracking.js doesn't fire off 30x a second, just 3.

getUserMedia({ audio: false, video: { facingMode: 'user', width: { ideal: 1280 }, height: { ideal: 720 }, frameRate: { ideal: 10, max: 10 } } })