-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlec_2.py
More file actions
22 lines (15 loc) · 788 Bytes
/
Copy pathlec_2.py
File metadata and controls
22 lines (15 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import numpy as np
import matplotlib.pyplot as plt
import cv2
img1 = np.zeros(shape=(500, 500, 3) , dtype=np.int32)
print(img1.shape)
cv2.rectangle(img1, pt1=(300,300), pt2=(400,400), color=(135,130,180), thickness=5)
font = cv2.FONT_HERSHEY_COMPLEX
cv2.putText(img1, text="RAHUL choudhary" ,org=(25,250), fontFace= font, fontScale=1, color=(80,140,240) , thickness=2)
img3 = np.zeros(shape=(500,500,3), dtype=np.int32)
vertice = np.array([[100,50],[300,250],[200,180],[400,50]], dtype=np.int32)
cv2.polylines(img3, [vertice] , isClosed=True, color=(180,45,60), thickness=2)
vertice2 = np.array([[(450, 250), (309, 439), (140, 404), (140, 96), (309, 61)]], dtype=np.int32)
cv2.polylines(img3, [vertice2] , isClosed=True, color=(60,45,100), thickness=2)
plt.imshow(img3)
plt.show()