1.转换矩阵数据类型(matlab / python_numpy_opencv)
img = single(img)
img = img.astype(float)
2.read mat in python
import scipy.io as sio
matfile = 'data.mat'
raw_data = sio.loadmat(matfile)
# type(raw_data) is dict
raw_data = raw_data["some key"].ravel()
boxes = raw_data[:, (1,0,3,2)]-1
Use [:, (1,0,3,2)] to change index order, and -1 since matlab index starting from 1 while python from 0.