samples: use findFile() in "python"
This commit is contained in:
committed by
Alexander Alekhin
parent
9ea8c775f8
commit
c371df4aa2
@@ -4,12 +4,12 @@ import numpy as np
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description='Code for Feature Detection tutorial.')
|
||||
parser.add_argument('--input1', help='Path to input image 1.', default='../data/box.png')
|
||||
parser.add_argument('--input2', help='Path to input image 2.', default='../data/box_in_scene.png')
|
||||
parser.add_argument('--input1', help='Path to input image 1.', default='box.png')
|
||||
parser.add_argument('--input2', help='Path to input image 2.', default='box_in_scene.png')
|
||||
args = parser.parse_args()
|
||||
|
||||
img1 = cv.imread(args.input1, cv.IMREAD_GRAYSCALE)
|
||||
img2 = cv.imread(args.input2, cv.IMREAD_GRAYSCALE)
|
||||
img1 = cv.imread(cv.samples.findFile(args.input1), cv.IMREAD_GRAYSCALE)
|
||||
img2 = cv.imread(cv.samples.findFile(args.input2), cv.IMREAD_GRAYSCALE)
|
||||
if img1 is None or img2 is None:
|
||||
print('Could not open or find the images!')
|
||||
exit(0)
|
||||
|
||||
Reference in New Issue
Block a user