Package pyvision :: Package face :: Module FilterEyeLocator :: Class OpenCVFilterEyeLocator
[hide private]
[frames] | no frames]

Class OpenCVFilterEyeLocator

source code

This class is used for someone only interested in locating the eyes in an image using correlation filters. This class does not include any support for training correlation filters. For training see ASEF. This class is written only using OpenCV and is much faster than the ASEF class.

For details see the paper:

David S. Bolme, Bruce A. Draper, and J. Ross Beveridge. Average of Synthetic Exact Filters. Submitted to Computer Vision and Pattern Recoginition. 2009.

The class uses two ASEF filters to find the eyes. The eyes are located by first computing the correlation of the face tile with each filter. The max value from the correlation plain is returned as the eye coordinate. Also returned is the full correlation output from the image.

The images are normalized by computing log transforming the pixel values

To improve performance, this class is not thread safe. The class reuses data arrays allocated for each call to use this class for multiple threads you should create an instance for each threads. Also note that each method call may overwrite arrays returned by this application. So if you need the returned data to persist be sure to create a copy.

Instance Methods [hide private]
 
__init__(self, left_filter, right_filter, left_rect, right_rect) source code
 
locateEyes(self, image_tile)
Returns: a tuple consisting of the location of the left and right eyes (opencv 2D points), and the complex correlation plain output
source code
 
_preprocess(self, image_tile)
preprocess an image tile.
source code
 
correlate(self, image_tile)
Correlate the image with the left and right filters.
source code
Method Details [hide private]

__init__(self, left_filter, right_filter, left_rect, right_rect)
(Constructor)

source code 
Parameters:
  • left_filter - is in the Fourier domain where the left eye corresponds to the real output and the right eye corresponds to the imaginary output

locateEyes(self, image_tile)

source code 
Parameters:
  • image_tile (8-bit gray scale opencv image) - is an 32-bit gray scale opencv image tile of a face that is the same size as the filter
Returns:
a tuple consisting of the location of the left and right eyes (opencv 2D points), and the complex correlation plain output
Raises:
  • AssertionError - is raised if the image is not 8-bit or not the same size as the filter