Image translation using numpy
问题 I want to perform image translation by a certain amount (shift the image vertically and horizontally). The problem is that when I paste the cropped image back on the canvas, I just get back a white blank box. Can anyone spot the issue here? Many thanks img_shape = image.shape # translate image # percentage of the dimension of the image to translate translate_factor_x = random.uniform(*translate) translate_factor_y = random.uniform(*translate) # initialize a black image the same size as the