Complete the code to rotate the image by 45 degrees using scipy.
from scipy.ndimage import rotate rotated_image = rotate(image, [1])
The rotate function takes the angle in degrees. To rotate by 45 degrees, use 45.
Complete the code to zoom the image by a factor of 2 using scipy.
from scipy.ndimage import zoom zoomed_image = zoom(image, [1])
The zoom function scales the image. A factor of 2 doubles the size.
Fix the error in the code to rotate the image without changing its shape.
rotated_image = rotate(image, 30, [1]=False)
The reshape parameter controls if the output shape changes. Setting reshape=False keeps the original shape.
Fill both blanks to zoom the image by 1.5 and rotate it by 90 degrees.
zoomed_image = zoom(image, [1]) rotated_image = rotate(zoomed_image, [2])
Use 1.5 to zoom by 1.5 times and 90 to rotate by 90 degrees.
Fill all three blanks to rotate the image by 180 degrees, zoom by 0.75, and keep the original shape after rotation.
rotated_image = rotate(image, [1], [2]=False) final_image = zoom(rotated_image, [3])
Rotate by 180 degrees, set reshape=False to keep shape, and zoom by 0.75 to reduce size.