-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics.py
More file actions
29 lines (23 loc) · 743 Bytes
/
Copy pathbasics.py
File metadata and controls
29 lines (23 loc) · 743 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
import cv2
import numpy as np
def ef():
pass
def main():
img=np.zeros((512,512,3),np.uint8)
windowName = 'OpenCV BGR Color Pal'
cv2.namedWindow(windowName)
cv2.createTrackbar('b',windowName,0,255,ef)
cv2.createTrackbar('g',windowName,0,255,ef)
cv2.createTrackbar('r',windowName,0,255,ef)
while(True):
cv2.imshow(windowName,img)
if cv2.waitKey(1) ==27:
break;
blue=cv2.getTrackbarPos('b',windowName)
green=cv2.getTrackbarPos('g',windowName)
red=cv2.getTrackbarPos('r',windowName)
img[:]=[blue,green,red]
print(blue,green,red)
cv2.destroyAllWindows()
if __name__=="__main__":
main()