GClasses

GClasses::GSubImageFinder Class Reference

This class uses Fourier phase correlation to efficiently find sub-images within a larger image. More...

#include <GRegion.h>

List of all members.

Public Member Functions

 GSubImageFinder (GImage *pHaystack)
 pHaystack is the image that will be searched for sub-images. Its dimensions do not need to be powers of 2.
 ~GSubImageFinder ()
void findSubImage (int *pOutX, int *pOutY, GImage *pNeedle, GRect *pNeedleRect, GRect *pHaystackRect)
 The width and height of pNeedleRect must be powers of 2 and less than the dimensions of pHaystack. pNeedleRect specifies the portion of pNeedle to search for. pHaystackRect allows you to restrict the range. Note that restricting the range does not really improve performance. Also note that it's okay for pHaystackRect to range outside of the bounds of pImage.

Static Public Member Functions

static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure.

Protected Attributes

int m_nHaystackWidth
int m_nHaystackHeight
int m_nHaystackX
int m_nHaystackY
struct ComplexNumberm_pHaystackRed
struct ComplexNumberm_pHaystackGreen
struct ComplexNumberm_pHaystackBlue
struct ComplexNumberm_pNeedleRed
struct ComplexNumberm_pNeedleGreen
struct ComplexNumberm_pNeedleBlue
struct ComplexNumberm_pCorRed
struct ComplexNumberm_pCorGreen
struct ComplexNumberm_pCorBlue

Detailed Description

This class uses Fourier phase correlation to efficiently find sub-images within a larger image.


Constructor & Destructor Documentation

GClasses::GSubImageFinder::GSubImageFinder ( GImage pHaystack)

pHaystack is the image that will be searched for sub-images. Its dimensions do not need to be powers of 2.

GClasses::GSubImageFinder::~GSubImageFinder ( )

Member Function Documentation

void GClasses::GSubImageFinder::findSubImage ( int *  pOutX,
int *  pOutY,
GImage pNeedle,
GRect pNeedleRect,
GRect pHaystackRect 
)

The width and height of pNeedleRect must be powers of 2 and less than the dimensions of pHaystack. pNeedleRect specifies the portion of pNeedle to search for. pHaystackRect allows you to restrict the range. Note that restricting the range does not really improve performance. Also note that it's okay for pHaystackRect to range outside of the bounds of pImage.

static void GClasses::GSubImageFinder::test ( ) [static]

Performs unit tests for this class. Throws an exception if there is a failure.


Member Data Documentation