GClasses
|
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 ComplexNumber * | m_pCorBlue |
struct ComplexNumber * | m_pCorGreen |
struct ComplexNumber * | m_pCorRed |
struct ComplexNumber * | m_pHaystackBlue |
struct ComplexNumber * | m_pHaystackGreen |
struct ComplexNumber * | m_pHaystackRed |
struct ComplexNumber * | m_pNeedleBlue |
struct ComplexNumber * | m_pNeedleGreen |
struct ComplexNumber * | m_pNeedleRed |
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 | ( | ) |
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 |
Performs unit tests for this class. Throws an exception if there is a failure.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |