samples: fix python samples compatibility with demo.py

This commit is contained in:
Alexander Alekhin
2019-03-19 21:03:58 +03:00
parent f4c2c4412b
commit 04fad57fc1
48 changed files with 678 additions and 403 deletions
+8 -2
View File
@@ -30,9 +30,8 @@ def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
if __name__ == '__main__':
def main():
import sys, getopt
print(__doc__)
args, video_src = getopt.getopt(sys.argv[1:], '', ['cascade=', 'nested-cascade='])
try:
@@ -70,4 +69,11 @@ if __name__ == '__main__':
if cv.waitKey(5) == 27:
break
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()