Note that all of the methods contained within this class are currently inlined in
order to eliminate subroutine call overhead.
Note that all of the methods contained within this class are currently inlined in
order to eliminate subroutine call overhead.
__abs |
private
int __abs( int value)
Computes the absolute value of the input.
- value
- Input value.
__alloc |
private
void __alloc( unsigned int width, unsigned int height)
Default image buffer allocator.
- width
- Default width of the source image buffer in pixels.
- height
- Default height of the source image buffer in pixels.
__alloc(image_struct *, unsigned int) |
private
void __alloc( image_struct *images, unsigned int index)
Initializes the image structure in our image buffer array at the location referenced by the specified
index value with a user specified image structure.
- images
- Array of user specified image structures to initialize our image buffer array with.
- index
- Location in array of image structures to copy image buffer (as well as any associated state) from.
__alloc(unsigned int) |
private
void __alloc( unsigned int index)
Allocates and initializes the image structure located at the specified index value.
- index
- Image structure location to allocate and initialize in image buffer array.
__cache |
private
void __cache( unsigned int index)
Saves the source image buffer (as well as any associated state) into the array of image structures
at the location referenced by the specified index value.
- index
- Location in array of image structures used to save source image buffer.
__clear |
private
void __clear( void)
Clears all pixels in the U, V (i.e. B, R luminance) channels of the source image buffer.
__hash |
private
void __hash( void)
Generates a hash value for the source image buffer.
__invert |
private
void __invert( void)
Inverts all pixels contained within the Y channel (i.e. luminance) of the source image buffer.
__sobel |
private
void __sobel( void)
Runs the Sobel convolution over all pixels contained within the Y channel (i.e. luminance) of
the source image buffer.
__sum |
private
void __sum( unsigned int index)
Calculates the sum of absolute differences between the Y channels (i.e. luminance) of the
source and selected image buffers.
- index
- Location in array of image buffers used for difference calculation.
CachePixels |
private
void CachePixels( void)
Saves the source image buffer (as well as any associated state) into the array of image structures.
ComparePixels |
private
unsigned char* ComparePixels( void)
Runs the implemented comparison operation (sum of absolute differences) against
all pixels in the Y channel (i.e. luminance) of the selected image buffers (from
the array of image structures) and the Y channel of the source image buffer.
FaceDetector |
public
~FaceDetector()
Destructor for the FaceDetector class.
FaceDetector(image_struct *, unsigned int, unsigned int, unsigned int) |
public
FaceDetector( image_struct *images, unsigned int count, unsigned int width, unsigned int height) : image_count( count)
Constructor for the FaceDetector class used to configure and initialize our image buffer array using
a user specified array of image structures.
- images
- Array of user specified image structures from which to initialize our image buffer array with.
- count
- Default number of image structures to allocate.
- width
- Default width of the source image buffer in pixels.
- height
- Default height of the source image buffer in pixels.
FaceDetector(unsigned int, unsigned int, unsigned int) |
public
FaceDetector( unsigned int count, unsigned int width, unsigned int height) : image_count( count)
Constructor for the FaceDetector class used to configure and initialize our image buffer array using the
default allocator.
- count
- Default number of image structures to allocate.
- width
- Default width of the source image buffer in pixels.
- height
- Default height of the source image buffer in pixels.
FilterPixels |
private
void FilterPixels( void)
Image post-processing stage used to filter (if necessary) the source image buffer before further processing.
HasFace |
public
unsigned char* HasFace( unsigned char *pixels, unsigned int range, unsigned int width, unsigned int height, flags_struct flags)
This routine acts as a simple wrapper around any underlying image processing (e.g. FilterPixels) and image comparison (e.g. ComparePixels) stages.
- pixels
- Pointer to the YUV 4:2:0 format source image buffer.
- range
- Differencing range used during image comparison.
- width
- Width of source image buffer in pixels.
- height
- Height of source image buffer in pixels.
- flags
- Configuration settings associated with the source image buffer.
~FaceDetector |
public
~FaceDetector()
Destructor for the FaceDetector class.
image |
private image_struct image;
Image structure for the source image buffer.
image_buffer |
private image_struct *image_buffer;
Pointer to the array of allocated image structures.
image_count |
private unsigned int image_count;
Number of image structures to allocate.
image_diff |
private unsigned int image_diff
Differencing value returned from image buffer comparison.
image_index |
private unsigned int image_index;
Index into array of allocated image structures.
image_pixels |
private unsigned char *image_pixels;
Pointer to empty image buffer used for convolution.
image_range |
private unsigned int image_range;
Differencing range used during image buffer comparison.
(Last Updated September 12, 2006)