在使用opencv2的warpAffine函数对照片进行平移处理的时候宽高颠倒
def Image_traslation(img):
h_move = random.randint(0, 200)
rows, cols = img.shape[:2]
print(rows, cols)
img_shift = np.float32([[0, 1, 0], [1, 0, h_move]])
img_new = cv2.warpAffine(img, img_shift, (cols, rows))
return img_new
请问该如何解决这个问题