samples: use findFile() in "python"

This commit is contained in:
Alexander Alekhin
2018-11-14 18:56:21 +03:00
committed by Alexander Alekhin
parent 9ea8c775f8
commit c371df4aa2
69 changed files with 179 additions and 173 deletions
@@ -15,14 +15,14 @@ def on_trackbar(val):
## [on_trackbar]
parser = argparse.ArgumentParser(description='Code for Adding a Trackbar to our applications tutorial.')
parser.add_argument('--input1', help='Path to the first input image.', default='../data/LinuxLogo.jpg')
parser.add_argument('--input2', help='Path to the second input image.', default='../data/WindowsLogo.jpg')
parser.add_argument('--input1', help='Path to the first input image.', default='LinuxLogo.jpg')
parser.add_argument('--input2', help='Path to the second input image.', default='WindowsLogo.jpg')
args = parser.parse_args()
## [load]
# Read images ( both have to be of the same size and type )
src1 = cv.imread(args.input1)
src2 = cv.imread(args.input2)
src1 = cv.imread(cv.samples.findFile(args.input1))
src2 = cv.imread(cv.samples.findFile(args.input2))
## [load]
if src1 is None:
print('Could not open or find the image: ', args.input1)