March 2019
Intermediate to advanced
538 pages
13h 38m
English
It is important that the faces are all aligned together, otherwise the face recognition algorithm might be comparing part of a nose with part of an eye, and so on. The output of the face detection we've just seen will give aligned faces to some extent, but it is not very accurate (that is, the face rectangle will not always be starting from the same point on the forehead).
To have better alignment, we will use eye detection to align the face, so the positions of the two detected eyes line up perfectly in the desired positions. We will do the geometrical transformation using the warpAffine() function, which is a single operation that will do the following four things: