I simply exported the MATLAB calibration matrices as a string using mat2str()
and pasted them in numpy using np.matrix("string")
. Maybe it would better two write a script for this, but for a few matrices it was all right.
Then you can simply export the numpy variables using np.savez_compressed("filename.npz", variable1=variable1, variable2=variable2,...)
with names matching your subsequent scripts.
Note that MATLAB and OpenCV use different notations and therefore you may need to transpose the camera matrices, R and T!