samples: use findFile() in "python"
This commit is contained in:
committed by
Alexander Alekhin
parent
9ea8c775f8
commit
c371df4aa2
+2
-2
@@ -53,10 +53,10 @@ def thresh_callback(val):
|
||||
## [setup]
|
||||
# Load source image
|
||||
parser = argparse.ArgumentParser(description='Code for Creating Bounding boxes and circles for contours tutorial.')
|
||||
parser.add_argument('--input', help='Path to input image.', default='../data/stuff.jpg')
|
||||
parser.add_argument('--input', help='Path to input image.', default='stuff.jpg')
|
||||
args = parser.parse_args()
|
||||
|
||||
src = cv.imread(args.input)
|
||||
src = cv.imread(cv.samples.findFile(args.input))
|
||||
if src is None:
|
||||
print('Could not open or find the image:', args.input)
|
||||
exit(0)
|
||||
|
||||
+2
-2
@@ -53,10 +53,10 @@ def thresh_callback(val):
|
||||
## [setup]
|
||||
# Load source image
|
||||
parser = argparse.ArgumentParser(description='Code for Creating Bounding rotated boxes and ellipses for contours tutorial.')
|
||||
parser.add_argument('--input', help='Path to input image.', default='../data/stuff.jpg')
|
||||
parser.add_argument('--input', help='Path to input image.', default='stuff.jpg')
|
||||
args = parser.parse_args()
|
||||
|
||||
src = cv.imread(args.input)
|
||||
src = cv.imread(cv.samples.findFile(args.input))
|
||||
if src is None:
|
||||
print('Could not open or find the image:', args.input)
|
||||
exit(0)
|
||||
|
||||
@@ -26,10 +26,10 @@ def thresh_callback(val):
|
||||
|
||||
# Load source image
|
||||
parser = argparse.ArgumentParser(description='Code for Finding contours in your image tutorial.')
|
||||
parser.add_argument('--input', help='Path to input image.', default='../data/HappyFish.jpg')
|
||||
parser.add_argument('--input', help='Path to input image.', default='HappyFish.jpg')
|
||||
args = parser.parse_args()
|
||||
|
||||
src = cv.imread(args.input)
|
||||
src = cv.imread(cv.samples.findFile(args.input))
|
||||
if src is None:
|
||||
print('Could not open or find the image:', args.input)
|
||||
exit(0)
|
||||
|
||||
@@ -33,10 +33,10 @@ def thresh_callback(val):
|
||||
|
||||
# Load source image
|
||||
parser = argparse.ArgumentParser(description='Code for Convex Hull tutorial.')
|
||||
parser.add_argument('--input', help='Path to input image.', default='../data/stuff.jpg')
|
||||
parser.add_argument('--input', help='Path to input image.', default='stuff.jpg')
|
||||
args = parser.parse_args()
|
||||
|
||||
src = cv.imread(args.input)
|
||||
src = cv.imread(cv.samples.findFile(args.input))
|
||||
if src is None:
|
||||
print('Could not open or find the image:', args.input)
|
||||
exit(0)
|
||||
|
||||
@@ -54,10 +54,10 @@ def thresh_callback(val):
|
||||
## [setup]
|
||||
# Load source image
|
||||
parser = argparse.ArgumentParser(description='Code for Image Moments tutorial.')
|
||||
parser.add_argument('--input', help='Path to input image.', default='../data/stuff.jpg')
|
||||
parser.add_argument('--input', help='Path to input image.', default='stuff.jpg')
|
||||
args = parser.parse_args()
|
||||
|
||||
src = cv.imread(args.input)
|
||||
src = cv.imread(cv.samples.findFile(args.input))
|
||||
if src is None:
|
||||
print('Could not open or find the image:', args.input)
|
||||
exit(0)
|
||||
|
||||
Reference in New Issue
Block a user