Created
January 8, 2015 01:17
-
-
Save benwaffle/eb13c2ac2f809dec79de to your computer and use it in GitHub Desktop.
edge detection in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from cv2 import * | |
cap = VideoCapture(0) | |
namedWindow('frame', flags=WINDOW_NORMAL) | |
createTrackbar('threshold', 'frame', 0, 1024, lambda x: x) | |
while(True): | |
ret, frame = cap.read() | |
x = getTrackbarPos('threshold','frame') | |
imshow('frame',Canny(frame, x, x)) | |
if waitKey(1) & 0xFF == ord('q'): break | |
cap.release() | |
destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment