I think the problem is related to size
np.mean(matrix_test, axis=0)
Its size is (128x128,), and not (1, 128x128). So the code below should work
mean, eigenvectors = cv.PCACompute(matrix_test, np.mean(matrix_test, axis=0).reshape(1,-1))
Dat chu
source share