samples: use findFile() in "python"
This commit is contained in:
committed by
Alexander Alekhin
parent
9ea8c775f8
commit
c371df4aa2
@@ -14,15 +14,15 @@ def main(argv):
|
||||
window_name = "copyMakeBorder Demo"
|
||||
## [variables]
|
||||
## [load]
|
||||
imageName = argv[0] if len(argv) > 0 else "../data/lena.jpg"
|
||||
imageName = argv[0] if len(argv) > 0 else 'lena.jpg'
|
||||
|
||||
# Loads an image
|
||||
src = cv.imread(imageName, cv.IMREAD_COLOR)
|
||||
src = cv.imread(cv.samples.findFile(imageName), cv.IMREAD_COLOR)
|
||||
|
||||
# Check if image is loaded fine
|
||||
if src is None:
|
||||
print ('Error opening image!')
|
||||
print ('Usage: copy_make_border.py [image_name -- default ../data/lena.jpg] \n')
|
||||
print ('Usage: copy_make_border.py [image_name -- default lena.jpg] \n')
|
||||
return -1
|
||||
## [load]
|
||||
# Brief how-to for this program
|
||||
|
||||
Reference in New Issue
Block a user