distrans.py sample added

This commit is contained in:
Alexander Mordvintsev
2011-07-02 22:21:19 +00:00
parent 724cc5b481
commit d3da43c8e5
3 changed files with 82 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ while True:
gray = cv2.cvtColor(img, cv.CV_BGR2GRAY)
thrs1 = cv2.getTrackbarPos('thrs1', 'edge')
thrs2 = cv2.getTrackbarPos('thrs2', 'edge')
edge = cv2.canny(gray, thrs1, thrs2, apertureSize=5)
edge = cv2.Canny(gray, thrs1, thrs2, apertureSize=5)
vis = img.copy()
vis /= 2
vis[edge != 0] = (0, 255, 0)