1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import cv2
import numpy as np
import matplotlib.pyplot as plt
img1 = np.zeros((200,200,3), np.uint8)
img2 = np.zeros((200,200,3), np.uint8)
cv2.putText(img1,'Hello OpenCV!',(10,100),cv2.FONT_HERSHEY_SIMPLEX, 0.8,(255,255,255),1,cv2.LINE_AA)
cv2.putText(img2,'Hello OpenCV!',(10,100),cv2.FONT_HERSHEY_SIMPLEX, 0.8,(255,255,255),1,cv2.LINE_AA,bottomLeftOrigin=True)
fig, axs = plt.subplots(1, 2)
axs[0].imshow(img1,cmap='gray')
axs[0].axis('off')
axs[0].set_title('img1')
axs[1].imshow(img2,cmap='gray')
axs[1].axis('off')
axs[1].set_title('img2')
|