(left, right, pupthreshold=50, glintthreshold=200, \
	glint=True, mode='diameter')
return B
Finds the pupils and the glints in image of the left and the
	right eye, and returns the relevant parameters. Parameters that
	cannot be found will be None.
	
	Arguments
	
	left			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the left eye.
	
	right			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the right eye.
	
	Keyword Arguments
	
	glint			-	A Boolean that indicates whether the glint
					(the corneal reflection) should also be
					detected. Default = True.
	
	mode			-	A string that indicates how the pupil size
					should be reported.
					'diameter' reports the width of the rect in
					which the thresholded pupil fits.
					'surface' reports the number of thresholded
					pixels that are assumed to be the pupil.
	
	Returns

	[L, R]		-	A NumPy array that contains the following:
	L = [px, py, ps, gx, gy]
	R = [px, py, ps, gx, gy]
				-	px is an integer indicating the pupil's
					likely horizontal position within the image.
					py is an integer indicating the pupil's
					likely vertical position within the image.
					ps is an integer indicating the pupil's
					size in pixels. The size reflects the width
					of the rect in which the pupil falls when
					mode=='diameter', or the total amount of
					thresholded pixels when mode=='surface'.
					gx is an integer indicating the pupil's
					likely horizontal position within the image.
					gy is an integer indicating the pupil's
					likely vertical position within the image.
					All of these values can be None if they
					could not be obtained.
Finds the pupils and the glints in image of the left and the
	right eye, and returns the relevant parameters. Parameters that
	cannot be found will be None.
	
	Arguments
	
	left			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the left eye.
	
	right			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the right eye.
	
	Keyword Arguments
	
	glint			-	A Boolean that indicates whether the glint
					(the corneal reflection) should also be
					detected. Default = True.
	
	mode			-	A string that indicates how the pupil size
					should be reported.
					'diameter' reports the width of the rect in
					which the thresholded pupil fits.
					'surface' reports the number of thresholded
					pixels that are assumed to be the pupil.
	
	Returns
Finds the pupils and the glints in image of the left and the right eye and returns the relevant parameters . Parameters that cannot be found will be None . Arguments left - A numpy . ndarray with unsigned 8 - bit integers that reflect the greyscale values of what is assumed to be the left eye . right - A numpy . ndarray with unsigned 8 - bit integers that reflect the greyscale values of what is assumed to be the right eye . Keyword Arguments glint - A Boolean that indicates whether the glint ( the corneal reflection ) should also be detected . Default = True . mode - A string that indicates how the pupil size should be reported . diameter reports the width of the rect in which the thresholded pupil fits . surface reports the number of thresholded pixels that are assumed to be the pupil . Returns
def _find_pupils(left, right, pupthreshold=50, glintthreshold=200, \
	glint=True, mode='diameter'):
	
	"""Finds the pupils and the glints in image of the left and the
	right eye, and returns the relevant parameters. Parameters that
	cannot be found will be None.
	
	Arguments
	
	left			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the left eye.
	
	right			-	A numpy.ndarray with unsigned, 8-bit
					integers that reflect the greyscale values
					of what is assumed to be the right eye.
	
	Keyword Arguments
	
	glint			-	A Boolean that indicates whether the glint
					(the corneal reflection) should also be
					detected. Default = True.
	
	mode			-	A string that indicates how the pupil size
					should be reported.
					'diameter' reports the width of the rect in
					which the thresholded pupil fits.
					'surface' reports the number of thresholded
					pixels that are assumed to be the pupil.
	
	Returns

	[L, R]		-	A NumPy array that contains the following:
	L = [px, py, ps, gx, gy]
	R = [px, py, ps, gx, gy]
				-	px is an integer indicating the pupil's
					likely horizontal position within the image.
					py is an integer indicating the pupil's
					likely vertical position within the image.
					ps is an integer indicating the pupil's
					size in pixels. The size reflects the width
					of the rect in which the pupil falls when
					mode=='diameter', or the total amount of
					thresholded pixels when mode=='surface'.
					gx is an integer indicating the pupil's
					likely horizontal position within the image.
					gy is an integer indicating the pupil's
					likely vertical position within the image.
					All of these values can be None if they
					could not be obtained.
	"""
	
	# Create an empty list to hold values for each of the eyes.
	B = numpy.zeros((2, 5))
	i = 0
	for eyeimg in [left, right]:
		if eyeimg is None:
			B[i,:] *= numpy.NaN
		else:
			B[i,:] = _process_eye_image(eyeimg, \
				pupthreshold=pupthreshold, glintthreshold=glintthreshold, \
				glint=True, mode=mode, debugindex=i)
		i += 1
	
	# In DEBUG mode, save and reset the image.
	if _DEBUG:
		global _FIG, _AX
		# Remove all axes' ticklabels
		for i in range(len(_AX)):
			for j in range(len(_AX[i])):
				_AX[i][j].set_xticklabels([])
				_AX[i][j].set_yticklabels([])
		# Save and close the figure.
		if not os.path.isdir(_DEBUGDIR):
			os.mkdir(_DEBUGDIR)
		f = unicode(len(os.listdir(_DEBUGDIR))).zfill(8)
		_FIG.savefig(os.path.join(_DEBUGDIR, u'%s.jpg' % (f)))
		pyplot.close(_FIG)
		# Reset the variables. (The global bit is there to tell Python that
		# _FIG and _AX do not refer to a local definition, but instead
		# refer to the global _FIG and _AX that are defined outside of this
		# function.)
		_FIG, _AX = pyplot.subplots(nrows=2, ncols=3)
	
	return B
def _find_pupils ( left , right , pupthreshold = 50 , glintthreshold = 200 , glint = True , mode = 'diameter' ) : # Create an empty list to hold values for each of the eyes. B = numpy . zeros ( ( 2 , 5 ) ) i = 0 for eyeimg in [ left , right ] : if eyeimg is None : B [ i , : ] *= numpy . NaN else : B [ i , : ] = _process_eye_image ( eyeimg , pupthreshold = pupthreshold , glintthreshold = glintthreshold , glint = True , mode = mode , debugindex = i ) i += 1 # In DEBUG mode, save and reset the image. if _DEBUG : global _FIG , _AX # Remove all axes' ticklabels for i in range ( len ( _AX ) ) : for j in range ( len ( _AX [ i ] ) ) : _AX [ i ] [ j ] . set_xticklabels ( [ ] ) _AX [ i ] [ j ] . set_yticklabels ( [ ] ) # Save and close the figure. if not os . path . isdir ( _DEBUGDIR ) : os . mkdir ( _DEBUGDIR ) f = unicode ( len ( os . listdir ( _DEBUGDIR ) ) ) . zfill ( 8 ) _FIG . savefig ( os . path . join ( _DEBUGDIR , u'%s.jpg' % ( f ) ) ) pyplot . close ( _FIG ) # Reset the variables. (The global bit is there to tell Python that # _FIG and _AX do not refer to a local definition, but instead # refer to the global _FIG and _AX that are defined outside of this # function.) _FIG , _AX = pyplot . subplots ( nrows = 2 , ncols = 3 ) return B