Skip to content

Commit 692617a

Browse files
assignment day live sketch day 3
1 parent 8543f13 commit 692617a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

live_sketcher.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import cv2
2+
3+
cap = cv2.VideoCapture(0)
4+
5+
while True:
6+
ret, frame = cap.read()
7+
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
8+
blur = cv2.GaussianBlur(gray , (5,5), 0)
9+
edge = cv2.Canny(blur, 70, 100)
10+
ret, thresh = cv2.threshold(edge,250, 255, cv2.THRESH_BINARY_INV)
11+
cv2.imshow("final",thresh)
12+
13+
if cv2.waitKey(33) == 27:
14+
break;
15+
cap.release()
16+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)