(self, imgdir=None, mode=u'RGB', **kwargs)
Use this function to implement the initialisation of a specific
		type of eye tracking.
		
		imgdir		-	String that is a path to the directory that
						contains the images of eyes. The names in
						the frame directory will be sorted, and are
						thus expected to be in a sortable format;
						for example '00000001.png', '00000002.png',
						etc. If None is passed, an Exception will be
						raised. Default = None.
		
		mode			-	String that indicates how the captured frame
						should be processed before it's returned.
						'R' returns the red component of the frame,
						'G' returns the green component of the frame,
						'B' returns the blue component of the frame,
						'RGB' returns the greyscale version of the
						frame (converted by OpenCV). Default = 'RGB'.
Use this function to implement the initialisation of a specific
		type of eye tracking.
		
		imgdir		-	String that is a path to the directory that
						contains the images of eyes. The names in
						the frame directory will be sorted, and are
						thus expected to be in a sortable format;
						for example '00000001.png', '00000002.png',
						etc. If None is passed, an Exception will be
						raised. Default = None.
		
		mode			-	String that indicates how the captured frame
						should be processed before it's returned.
						'R' returns the red component of the frame,
						'G' returns the green component of the frame,
						'B' returns the blue component of the frame,
						'RGB' returns the greyscale version of the
						frame (converted by OpenCV). Default = 'RGB'.
Use this function to implement the initialisation of a specific type of eye tracking . imgdir - String that is a path to the directory that contains the images of eyes . The names in the frame directory will be sorted and are thus expected to be in a sortable format ; for example 00000001 . png 00000002 . png etc . If None is passed an Exception will be raised . Default = None . mode - String that indicates how the captured frame should be processed before it s returned . R returns the red component of the frame G returns the green component of the frame B returns the blue component of the frame RGB returns the greyscale version of the frame ( converted by OpenCV ) . Default = RGB .
def connect(self, imgdir=None, mode=u'RGB', **kwargs):
		
		"""Use this function to implement the initialisation of a specific
		type of eye tracking.
		
		imgdir		-	String that is a path to the directory that
						contains the images of eyes. The names in
						the frame directory will be sorted, and are
						thus expected to be in a sortable format;
						for example '00000001.png', '00000002.png',
						etc. If None is passed, an Exception will be
						raised. Default = None.
		
		mode			-	String that indicates how the captured frame
						should be processed before it's returned.
						'R' returns the red component of the frame,
						'G' returns the green component of the frame,
						'B' returns the blue component of the frame,
						'RGB' returns the greyscale version of the
						frame (converted by OpenCV). Default = 'RGB'.
		"""
		
		# Only initialise if it hasn't been done yet.
		if not self._connected:
			
			# Set mode and camera number
			self._imgdir = imgdir
			self._mode = mode

			# DEBUG message.
			_message(u'debug', u'images.ImageTracker.connect', \
				u"Checking directory %s." % (self._imgdir))
		
			# Check whether the directory exists.
			if self._imgdir == None:
				_message(u'error', u'images.ImageTracker.connect', \
					u"No directory specified; use the imgdir keyword to pass the path to a directory with eye images.")
			if not os.path.isdir(self._imgdir):
				_message(u'error', u'images.ImageTracker.connect', \
					u"Image directory does not exist ('%s')" \
					% (self._imgdir))
			self._framenames = os.listdir(self._imgdir)
			self._framenames.sort()
			self._framenr = 0
			self._nframes = len(self._framenames)
			self._connected = True

			# DEBUG message.
			_message(u'debug', u'images.ImageTracker.connect', \
				u"Successfully connected to directory %s!" % (self._imgdir))
def connect ( self , imgdir = None , mode = u'RGB' , * * kwargs ) : # Only initialise if it hasn't been done yet. if not self . _connected : # Set mode and camera number self . _imgdir = imgdir self . _mode = mode # DEBUG message. _message ( u'debug' , u'images.ImageTracker.connect' , u"Checking directory %s." % ( self . _imgdir ) ) # Check whether the directory exists. if self . _imgdir == None : _message ( u'error' , u'images.ImageTracker.connect' , u"No directory specified; use the imgdir keyword to pass the path to a directory with eye images." ) if not os . path . isdir ( self . _imgdir ) : _message ( u'error' , u'images.ImageTracker.connect' , u"Image directory does not exist ('%s')" % ( self . _imgdir ) ) self . _framenames = os . listdir ( self . _imgdir ) self . _framenames . sort ( ) self . _framenr = 0 self . _nframes = len ( self . _framenames ) self . _connected = True # DEBUG message. _message ( u'debug' , u'images.ImageTracker.connect' , u"Successfully connected to directory %s!" % ( self . _imgdir ) )