Write a python script/function, that rotates an image by a given angle. The solution should consist of the following steps:
Some tips:
new_img = np.zeros( img.shape )
. This works both for gray-scale (2D) and colour (3D) image.x1
, y1
, x2
, y2
) as new_img[y2,x2] = img[y1,x1]
. Works for both gray-scale and RGB cases. In the first case, a single value is assigned, in the second case, the RGB vector is assigned.%run task_rot