def __init__(self, device_id=0):
		# Open the camera.
		self._camera = cv2.VideoCapture(device_id)
		if not self._camera.isOpened():
			self._camera.open()
		# Start a thread to continuously capture frames.
		# This must be done because different layers of buffering in the webcam
		# and OS drivers will cause you to retrieve old frames if they aren't 
		# continuously read.
		self._capture_frame = None
		# Use a lock to prevent access concurrent access to the camera.
		self._capture_lock = threading.Lock()
		self._capture_thread = threading.Thread(target=self._grab_frames)
		self._capture_thread.daemon = True
		self._capture_thread.start()
Create an OpenCV capture object associated with the provided webcam
dataset/ETHPy150Open tdicola/pi-facerec-box/webcam.py/OpenCVCapture.__init__