python部分:
img=cv2.imread("bmp/"+str(n)+".bmp") len = img.shape[0] * img.shape[1] * img.shape[2] img = img.reshape(-1) INPUT = c_int * len # 实例化一个长度为2的整型数组 input = INPUT() # 为数组赋值(input这个数组是不支持迭代的) for i in range(len): input[i] = img[i]
python部分:
img=cv2.imread("bmp/"+str(n)+".bmp") len = img.shape[0] * img.shape[1] * img.shape[2] img = img.reshape(-1) INPUT = c_int * len # 实例化一个长度为2的整型数组 input = INPUT() # 为数组赋值(input这个数组是不支持迭代的) for i in range(len): input[i] = img[i]