GClasses
GClasses::GSubImageFinder Class Reference

Detailed Description

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

#include <GRegion.h>

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. More...
 
 ~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. More...
 

Static Public Member Functions

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

Protected Attributes

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

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

int GClasses::GSubImageFinder::m_nHaystackHeight
protected
int GClasses::GSubImageFinder::m_nHaystackWidth
protected
int GClasses::GSubImageFinder::m_nHaystackX
protected
int GClasses::GSubImageFinder::m_nHaystackY
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pCorBlue
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pCorGreen
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pCorRed
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pHaystackBlue
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pHaystackGreen
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pHaystackRed
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pNeedleBlue
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pNeedleGreen
protected
struct ComplexNumber* GClasses::GSubImageFinder::m_pNeedleRed
protected