(self)
Reads the next frame from the active OpenCV VideoCapture.
		
		Keyword Arguments
		
		Returns
		
		success, frame	-	success is a Boolean that indicates whether
						a frame could be obtained.
						frame is a numpy.ndarray with unsigned,
						8-bit integers that reflect the greyscale
						values of the image. If no frame could be
						obtained, None will be returned.
Reads the next frame from the active OpenCV VideoCapture.
		
		Keyword Arguments
		
		Returns
		
		success, frame	-	success is a Boolean that indicates whether
						a frame could be obtained.
						frame is a numpy.ndarray with unsigned,
						8-bit integers that reflect the greyscale
						values of the image. If no frame could be
						obtained, None will be returned.
Reads the next frame from the active OpenCV VideoCapture . Keyword Arguments Returns success frame - success is a Boolean that indicates whether a frame could be obtained . frame is a numpy . ndarray with unsigned 8 - bit integers that reflect the greyscale values of the image . If no frame could be obtained None will be returned .
def _get_frame(self):
		
		"""Reads the next frame from the active OpenCV VideoCapture.
		
		Keyword Arguments
		
		Returns
		
		success, frame	-	success is a Boolean that indicates whether
						a frame could be obtained.
						frame is a numpy.ndarray with unsigned,
						8-bit integers that reflect the greyscale
						values of the image. If no frame could be
						obtained, None will be returned.
		"""
		
		# Take a photo with the webcam.
		# (ret is the return value: True if everything went ok, False if
		# there was a problem. frame is the image taken from the webcam as
		# a NumPy ndarray, where the image is coded as BGR
		ret, frame = self._vidcap.read()
		
		# If a new frame was available, proceed to process and return it.		
		if ret:
			# Return the red component of the obtained frame.
			if self._mode == 'R':
				return ret, frame[:,:,2]
			# Return the green component of the obtained frame.
			elif self._mode == 'G':
				return ret, frame[:,:,1]
			# Return the blue component of the obtained frame.
			elif self._mode == 'B':
				return ret, frame[:,:,0]
			# Convert to grey.
			elif self._mode == 'RGB':
				return ret, cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
			# Throw an exception if the mode can't be recognised.
			else:
				_message(u'error', u'webcam.WebCamTracker._get_frame', \
					u"Mode '%s' not recognised. Supported modes: 'R', 'G', 'B', or 'RGB'." \
					% (self._mode))
		
		# If a new frame wasn't available, return None.
		else:
			return ret, None
def _get_frame ( self ) : # Take a photo with the webcam. # (ret is the return value: True if everything went ok, False if # there was a problem. frame is the image taken from the webcam as # a NumPy ndarray, where the image is coded as BGR ret , frame = self . _vidcap . read ( ) # If a new frame was available, proceed to process and return it.		 if ret : # Return the red component of the obtained frame. if self . _mode == 'R' : return ret , frame [ : , : , 2 ] # Return the green component of the obtained frame. elif self . _mode == 'G' : return ret , frame [ : , : , 1 ] # Return the blue component of the obtained frame. elif self . _mode == 'B' : return ret , frame [ : , : , 0 ] # Convert to grey. elif self . _mode == 'RGB' : return ret , cv2 . cvtColor ( frame , cv2 . COLOR_BGR2GRAY ) # Throw an exception if the mode can't be recognised. else : _message ( u'error' , u'webcam.WebCamTracker._get_frame' , u"Mode '%s' not recognised. Supported modes: 'R', 'G', 'B', or 'RGB'." % ( self . _mode ) ) # If a new frame wasn't available, return None. else : return ret , None