1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

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
+9 -3
View File
@@ -20,17 +20,16 @@ from __future__ import print_function
import numpy as np
import cv2 as cv
from common import Sketcher
if __name__ == '__main__':
def main():
import sys
try:
fn = sys.argv[1]
except:
fn = 'fruits.jpg'
print(__doc__)
img = cv.imread(cv.samples.findFile(fn))
if img is None:
print('Failed to load image file:', fn)
@@ -51,4 +50,11 @@ if __name__ == '__main__':
img_mark[:] = img
mark[:] = 0
sketch.show()
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()