April 2017
Beginner to intermediate
250 pages
6h 28m
English
To make sure there is at least a 1 second gap between collecting new faces, we need to measure how much time has passed. This is done as follows:
// Check how long since the previous face was added.
double current_time = (double)getTickCount();
double timeDiff_seconds = (current_time -
old_time) / getTickFrequency();
To compare the similarity of two images, pixel by pixel, you can find the relative L2 error, which just involves subtracting one image from the other, summing the squared value of it, and then getting the square root of it. So if the person had not moved at all, subtracting the current face with the previous face should give a very low number at each pixel, but if they had just moved ...
Read now
Unlock full access