2. LOOKSERY+ +VIDEO SELFIES FACE FILTERS INTEGRATED CHAT
3. REAL-TIME FACE TRACKING DEMO3
4. - Algorithm based on Active Appearance Model.- Algorithm
complexity is independent from image size.- You can control balance
between tracking quality and tracking speedusing only two
constants.- Algorithm is iterative. Solve Least-Square problem at
each iteration.- Average 5 iterations per frame. Maximum 10,
minimum 1.- If you want run on 30 fps you have to perform about 150
iterations per second.4TRACKING ALGORITHM
5. Optimisation flow : Algorithm asymptotic optimisation3 FPS:
First implementation8 FPS: Memory preallocation10 FPS: Algorithm
parameters optimisation13 FPS: Matrix storage optimisation and
removing OOP code18 FPS: Rewrite bottleneck code at assembler24
FPS: Asymptotic optimisation of matrices multiplication27 FPS:
Replacing operations with float to operations with int30 FPS:
Multithreading5
6. From float to int6G[i][j] = (X[i][j] - Y[i][j]) / d[j];We
had to build so-called pseudo-inverse, that isSo we have to perform
many multiplication operations. Multiplication of two intis much
faster then multiplication of two float. Lets create int matrix
V:V[i][j] = X[i][j] - Y[i][j];And float matrix D:D[i][j] = ( i== j
? d[i] : 0); // diagonal matrixThen G = V * D. From linear
algebra:
7. 7CODE TIMEconst int ITERATIONS = 2000000000;long long sum =
0;for (int i = 0; i < ITERATIONS; i++)sum += i * (long
long)i;cout