Commit b0a42f48 authored by Stephen Thompson's avatar Stephen Thompson

Issue #22 added source flag

parent c442202f
......@@ -9,7 +9,7 @@ import cv2
import six
def run_demo(output_dir):
def run_demo(output_dir, source=0):
"""
Run this if you are facing invalid images issue
cap.release()
......@@ -18,7 +18,7 @@ def run_demo(output_dir):
if not os.path.isdir(output_dir):
os.mkdir(output_dir)
cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture(int(source))
i = 0 # to save all the clicked images
while True:
_, frame = cap.read()
......
......@@ -23,6 +23,14 @@ def main(args=None):
help="Save captured images to given directory"
)
parser.add_argument("-s",
"--source",
required=False,
default=0,
help="Camera To Use"
)
# ADD OPTINAL ARGUMENTS
parser.add_argument("-v", "--verbose",
......@@ -41,5 +49,6 @@ def main(args=None):
# Stores images in the directory.
output_dir = args.output
source = args.source
run_demo(output_dir)
run_demo(output_dir, source)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment