I\'m loading a set of test images via OpenCV (in Python) which are 128x128 in size, reshape them into vectors (1, 128x128) and put them all together in a matrix to calculate
You can also put
cv.PCACompute(matrix_test, mean = np.array([]))
and the function computes the mean.
I think the problem is with the size of
np.mean(matrix_test, axis=0)
Its size is (128x128,) and not (1, 128x128). Thus the code below should work
mean, eigenvectors = cv.PCACompute(matrix_test, np.mean(matrix_test, axis=0).reshape(1,-1))