-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
36 lines (23 loc) · 695 Bytes
/
utils.py
File metadata and controls
36 lines (23 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Utility Functions
import matplotlib.pyplot as plt
import numpy as np
# Plot two grayscale images
def plot_two_images_gray(img_1: np.array, img_2: np.array, title_1: str, title_2: str):
plt.figure()
ax1 = plt.subplot(1, 2, 1)
plt.title(title_1)
ax1.imshow(img_1, cmap='gray')
ax2 = plt.subplot(1, 2, 2)
plt.title(title_2)
ax2.imshow(img_2, cmap='gray')
plt.show()
# Plot two images
def plot_two_images(img_1: np.array, img_2: np.array, title_1: str, title_2: str):
plt.figure()
ax1 = plt.subplot(1, 2, 1)
plt.title(title_1)
ax1.imshow(img_1)
ax2 = plt.subplot(1, 2, 2)
plt.title(title_2)
ax2.imshow(img_2)
plt.show()