samples: fix python samples compatibility with demo.py
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user