-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtell_me.py
40 lines (28 loc) · 870 Bytes
/
tell_me.py
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
35
36
37
38
39
40
import cv2
import numpy as np
def main():
cap = cv2.VideoCapture(0)
cap.set(3,256)
cap.set(4,192)
if cap.isOpened():
ret, frame = cap.read()
print(ret)
print(frame)
else:
ret=False
while ret:
ret, frame=cap.read()
hsv=cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
#blue
low = np.array([100,50,50])
high = np.array([140,255,255])
imask = cv2.inRange(hsv,low,high)
final = cv2.bitwise_and(frame,frame,mask=imask)
cv2.imshow("masked",final)
cv2.imshow("image mask",imask)
cv2.imshow("original Feed",frame)
if cv2.waitKey(1) == 27:
break
cv2.destroyAllWindows()
if __name__ ==("__main__"):
main()