To view the eigenvectors (as Eigenface or Fisherface images), we must extract them as columns from the big eigenvectors matrix. As data in OpenCV and C/C++ is normally stored in matrices using row-major order, it means that to extract a column, we should use the Mat::clone() function to ensure the data will be continuous, otherwise we can't reshape the data to a rectangle. Once we have a continuous column Mat, we can display the eigenvectors using the getImageFrom1DFloatMat()
function just like we did for the average face: