added comments to contours.py and edge.py samples
This commit is contained in:
parent
a3220a446f
commit
d49c697fda
@ -1,3 +1,12 @@
|
|||||||
|
'''
|
||||||
|
This program illustrates the use of findContours and drawContours.
|
||||||
|
The original image is put up along with the image of drawn contours.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
contours.py
|
||||||
|
A trackbar is put up which controls the contour level from -3 to 3
|
||||||
|
'''
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import cv2
|
import cv2
|
||||||
|
|
||||||
@ -30,6 +39,8 @@ def make_image():
|
|||||||
return img
|
return img
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
print __doc__
|
||||||
|
|
||||||
img = make_image()
|
img = make_image()
|
||||||
h, w = img.shape[:2]
|
h, w = img.shape[:2]
|
||||||
|
|
||||||
|
@ -1,8 +1,21 @@
|
|||||||
|
'''
|
||||||
|
This sample demonstrates Canny edge detection.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
edge.py [<video source>]
|
||||||
|
|
||||||
|
Trackbars control edge thresholds.
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import video
|
import video
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
print __doc__
|
||||||
|
|
||||||
try: fn = sys.argv[1]
|
try: fn = sys.argv[1]
|
||||||
except: fn = 0
|
except: fn = 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user