1. 하나의 이미지 보이기
import matplotlib.pyplot as plt
import cv2
file_name = ""
image = cv2.imread(file_name)
rgb_image = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(rgb_image)
plt.axis('off')
plt.show()
2. 여러 이미지 보이기
import cv2
import matplotlib.pyplot as plt
rows =
cols =
fig, axes = plt.subplots(rows, cols, figsize=(x,x))
img_list = []
# plt 대신 axes 사용
for image in img_list:
img = cv2.imread(image)
rgb_image = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
axes[row,col].imshow(rgb_image)
axes[row,col].axis('off')
plt.show()