samples: use findFile() in "python"
This commit is contained in:
committed by
Alexander Alekhin
parent
9ea8c775f8
commit
c371df4aa2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user