import numpy as np
import matplotlib.pyplot as plt
import cv2
plt.rcParams['figure.figsize'] = [10, 10]
# Question 2
h1 = np.zeros((512,512))
h1[100:350,200:300] = 1
plt.imshow(h1,cmap='gray')
plt.show()
# Question 3
def ImTranslate(h,tau):
# to do...
v = ImTranslate(h1,[300,53])
plt.imshow(v,cmap='gray')
plt.show()
# Question 4
def DSN(h,n):
# to do...
for n in [10,100,1000]:
u = DSN(h1,n)
plt.imshow(u,cmap='gray')
plt.show()
# Question 5
def GaussImage(N,b):
t = np.linspace(-b,b,N).reshape(N,1)
return np.exp(-t**2-(t.T)**2)
# to do...