Skip to Content
Building Computer Vision Projects with OpenCV 4 and C++
book

Building Computer Vision Projects with OpenCV 4 and C++

by David Millan Escriva, Prateek Joshi, Vinicius G. Mendonca, Roy Shilkrot
March 2019
Intermediate to advanced
538 pages
13h 38m
English
Packt Publishing
Content preview from Building Computer Vision Projects with OpenCV 4 and C++

Average face

Both the Eigenfaces and Fisherfaces algorithms first calculate the average face that is the mathematical average of all the training images, so they can subtract the average image from each facial image to have better face recognition results. So, let's view the average face from our training set. The average face is named mean in the Eigenfaces and Fisherfaces implementations, shown as follows:

    Mat averageFace = model->get<Mat>("mean");     printMatInfo(averageFace, "averageFace (row)");     // Convert a 1D float row matrix to a regular 8-bit image.     averageFace = getImageFrom1DFloatMat(averageFace, faceHeight);     printMatInfo(averageFace, "averageFace");     imshow("averageFace", averageFace);

You should now see an average face image ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Joseph Howse, Joe Minichino
Modern CMake for C++

Modern CMake for C++

Rafał Świdziński

Publisher Resources

ISBN: 9781838644673Supplemental Content