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
@@ -19,13 +19,12 @@ import cv2 as cv
from common import make_cmap
if __name__ == '__main__':
def main():
import sys
try:
fn = sys.argv[1]
except:
fn = 'fruits.jpg'
print(__doc__)
fn = cv.samples.findFile(fn)
img = cv.imread(fn, cv.IMREAD_GRAYSCALE)
@@ -69,4 +68,11 @@ if __name__ == '__main__':
update()
if need_update:
update()
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()