mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
samples: fix python samples compatibility with demo.py
This commit is contained in:
@@ -30,13 +30,11 @@ def draw_detections(img, rects, thickness = 1):
|
||||
cv.rectangle(img, (x+pad_w, y+pad_h), (x+w-pad_w, y+h-pad_h), (0, 255, 0), thickness)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
import sys
|
||||
from glob import glob
|
||||
import itertools as it
|
||||
|
||||
print(__doc__)
|
||||
|
||||
hog = cv.HOGDescriptor()
|
||||
hog.setSVMDetector( cv.HOGDescriptor_getDefaultPeopleDetector() )
|
||||
|
||||
@@ -68,4 +66,11 @@ if __name__ == '__main__':
|
||||
ch = cv.waitKey()
|
||||
if ch == 27:
|
||||
break
|
||||
|
||||
print('Done')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(__doc__)
|
||||
main()
|
||||
cv.destroyAllWindows()
|
||||
|
||||
Reference in New Issue
Block a user