1. AIR UNIVERSITY
Department of Electrical and Computer Engineering
Digital Image Processing Lab
Lab #3: Image Generation
Student Name: Umar Mustafa
Roll No: 200365
Instructor: Engr. M. Farooq Khan
Conclusion
Python Image generation (synthesis) is the task of generating new images from an existing dataset. Unconditional generation refers to generating samples unconditionally from the
dataset.
Enhancement of the image space that divides an image into uniform pixels according to the spatial coordinates with a particular resolution is spacial domain.
Frequency Domain Filters are used for smoothing and sharpening of image by removal of high or low frequency components. Sometimes it is possible of removal of very high and very
low frequency.
In [2]: import numpy as np
import matplotlib.pyplot as plt
n1_vals = np.arange(0, 8)
n2_vals = np.arange(0, 8)
omega1_vals = [0, np.pi/8, np.pi/4, np.pi/2, np.pi]
omega2_vals = [0, np.pi/8, np.pi/4, np.pi/2, np.pi]
for omega1 in omega1_vals:
for omega2 in omega2_vals:
x = np.zeros((8, 8))
for n1 in n1_vals:
for n2 in n2_vals:
x[n1, n2] = np.cos(omega1 * n1 + omega2 * n2)
x_quantized = np.round((x + 1) * 127.5).astype(np.uint8)
plt.imshow(x_quantized, cmap='gray', vmin=0, vmax=255)
plt.show()