The cv2.PCACompute
function worked well in OpenCV 2.4 using the following syntax :
import cv2
mean, eigvec = cv2.PCACompute(data)
The function exists in OpenCV 3.1, but raises the following exception :
TypeError: Required argument 'mean' (pos 2) not found
The C++ documentation is not very helpful at explaining how I should call it from Python. I'm guessing that InputOutputArray
arguments are now also mandatory arguments in the Python function signature, but I am unable to find a way to make them work.
Is there a way I can call it properly?
(Note: I know there are other ways I can run a PCA, and I'll probably end up with one of them. I'm just curious about how the new OpenCV bindings works.)