Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support to set web cam resolution #68

Open
wants to merge 4 commits into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -20,7 +20,7 @@ def __init__(self, src=0, usePiCamera=False, resolution=(320, 240),
# otherwise, we are using OpenCV so initialize the webcam
# stream
else:
self.stream = WebcamVideoStream(src=src)
self.stream = WebcamVideoStream(src=src, resolution=resolution)

def start(self):
# start the threaded video stream
@@ -36,4 +36,4 @@ def read(self):

def stop(self):
# stop the thread and release any resources
self.stream.stop()
self.stream.stop()
@@ -3,10 +3,12 @@
import cv2

class WebcamVideoStream:
def __init__(self, src=0, name="WebcamVideoStream"):
def __init__(self, src=0, name="WebcamVideoStream" resolution=(640, 480)):

This comment has been minimized.

Copy link
@jcRisch

jcRisch Nov 20, 2018

You missed a coma between name="WebcamVideoStream" and resolution=(640, 480) .
Otherwise everything is ok for me !

# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
self.stream.set(3, int(resolution[0]))
self.stream.set(4, int(resolution[1]))
(self.grabbed, self.frame) = self.stream.read()

# initialize the thread name
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.