Complete the code to import the interpolation function from scipy.
from scipy import [1]
The interpolate module in scipy contains functions for image interpolation.
Complete the code to create a 2D interpolation function from image data.
interp_func = scipy.interpolate.RegularGridInterpolator((x, y), [1])The interpolation function needs the original image data array to create the interpolator.
Fix the error in the code to interpolate the image at new points.
new_values = interp_func([1])The RegularGridInterpolator expects a 2D array of points, so the new points must be inside a list of lists.
Fill both blanks to create a dictionary of interpolated pixel values for points where x is greater than 5.
interp_points = {point: interp_func([point])[1] point in points if point[0] [2] 5}The dictionary comprehension syntax requires 'for' before the loop variable, and the condition checks if the x-coordinate (point[0]) is greater than 5.
Fill all three blanks to create a new image by interpolating at scaled coordinates.
scaled_image = [1]([2] * scale_factor, [3] * scale_factor, method='linear')
The interpn function interpolates on a grid defined by coordinate arrays. We scale the x and y coordinates to get new points for interpolation.