Question: Please help compute the 2D gaussian kernel and store it in kernel, and the normalized kernel and store it in kernel_norm 30 31 32 33
Please help compute the 2D gaussian kernel and store it in kernel, and the normalized kernel and store it in kernel_norm
30 31 32 33 34 35 def gaussian_2D kernel(size=5, sigma=3.0): # get x, y coordinates using np.meshgrid function x, y = np.meshgrid(np.linspace(-1, 1, size), np.linspace(-1, 1, size)) # YOUR CODES #1 6 points # Step 1: Compute a 2D gaussian kernel and store it in kernel # Step 2: Compute the normalized kernel and store it in kernel_norm # Hint: the sum of the numbers in the kernel is 1.0 kernel kernel_norm print("2D Gaussian-like array:") print(kernel_norm) return kernel_norm 36 37 38 39 40 41
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
