auduno / clmtrackr

Javascript library for precise tracking of facial features via Constrained Local Models
MIT License
6.51k stars 1.16k forks source link

Increase canvas size to match video element, improve quality? #153

Open risoms opened 6 years ago

risoms commented 6 years ago

Hello, I’m wondering if it’s possible to increase the canvas size (right now at 300x150 pixels) to match the video element used for face detection. If it is possible, does this provide any better estimate accuracy? The reason I ask is that I’m working with a webcam with 4K resolution and it would seem like a waste to not make the most of the resolution.

FilipChalupa commented 4 years ago

With that kind of resolution you would need very fast CPU. Some image computations are better done on smaller resolution.

andrevenancio commented 4 years ago

It depends @risoms.

If we're talking about real time face detection it will be slower because there are more pixels to analyse, but if you're analysing a video and extracting x,y coordinates to a "animation" array, then 4k will improve the accuracy.

clmtrackr uses WebGL to analyse the frames of the video element. so they are rendered on the GPU instead of the CPU.