The blo Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Related Functions | List of all members
blo::ImageCrossCorrelation< T, C > Class Template Reference

Cross-correlation processor. More...

#include <ImageCrossCorrelation.h>

Public Types

enum class  Method { crossCorr = 0x00000000 , normCrossCorr = 0x00000100 , corrCoeff = 0x00000200 }
 
enum class  Shape { full = 0x00000000 , same = 0x00020000 , valid = 0x00010000 }
 

Public Member Functions

 ImageCrossCorrelation ()
 Default constructor.
 
 ImageCrossCorrelation (int srcWidth, int srcHeight, int tplWidth, int tplHeight)
 Constructs cross-correlation processor of specified size work buffers.
 
 ImageCrossCorrelation (const ImageCrossCorrelation &rhs)
 Copy constructor.
 
 ImageCrossCorrelation (ImageCrossCorrelation &&rhs) noexcept
 Move constructor.
 
virtual ~ImageCrossCorrelation ()
 Destructor.
 
ImageCrossCorrelation & operator= (const ImageCrossCorrelation &rhs)
 Copy assignment operator.
 
ImageCrossCorrelation & operator= (ImageCrossCorrelation &&rhs) noexcept
 Move assignment operator.
 
void setMethod (Method method)
 Sets cross-correlation method.
 
Method method () const
 Retrieves cross-correlation method.
 
void setShape (Shape shape)
 Sets shape parameter.
 
Shape shape () const
 Retrieves shape parameter.
 
void resize (int srcWidth, int srcHeight, int tplWidth, int tplHeight)
 Resizes work buffers.
 
void clear ()
 Resizes work buffers to zero width and zero height.
 
void calcCrossCorrelation (const T *pSrc, int srcStep, int srcRoiWidth, int srcRoiHeight, const T *pTpl, int tplStep, int tplRoiWidth, int tplRoiHeight, float *pDst, int dstStep)
 Calculates the cross-correlation between an image and a template.
 

Related Functions

(Note that these are not member functions.)

BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint8_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint16_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< float, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint8_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint16_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< float, 3 >
 

Detailed Description

template<typename T, size_t C>
class blo::ImageCrossCorrelation< T, C >

Cross-correlation processor.

Template Parameters
TData type.
CNumber of channels.

Member Enumeration Documentation

◆ Method

template<typename T , size_t C>
enum class blo::ImageCrossCorrelation::Method
strong
Note
Compatible with IppiNormOp.
Enumerator
crossCorr 

Cross-correlation.

normCrossCorr 

Normalized cross-correlation.

corrCoeff 

Correlation coefficient (in the range [-1, 1]).

◆ Shape

template<typename T , size_t C>
enum class blo::ImageCrossCorrelation::Shape
strong
Note
Compatible with IppiROIShape.
Enumerator
full 

Assume source image is zero-padded to size (srcWidth + 2 * (tplWidth - 1))-by-(srcHeight + 2 * (tplHeight - 1)). The destination image is (srcWidth + tplWidth - 1)-by-(srcHeight + tplHeight - 1).

same 

Assume source image is zero-padded to size (srcWidth + tplWidth - 1)-by-(srcHeight + tplHeight - 1). The destination image is srcWidth-by-srcHeight.

valid 

Do not assume source image is zero-padded. The destination image is (srcWidth - tplWidth + 1)-by-(srcHeight - tplHeight + 1).

Constructor & Destructor Documentation

◆ ImageCrossCorrelation() [1/4]

template<typename T , size_t C>
blo::ImageCrossCorrelation< T, C >::ImageCrossCorrelation ( )

Default constructor.

◆ ImageCrossCorrelation() [2/4]

template<typename T , size_t C>
blo::ImageCrossCorrelation< T, C >::ImageCrossCorrelation ( int  srcWidth,
int  srcHeight,
int  tplWidth,
int  tplHeight 
)

Constructs cross-correlation processor of specified size work buffers.

Parameters
srcWidthWidth of the source image in pixels to size work buffers to.
srcHeightHeight of the source image in pixels to size work buffers to.
tplWidthWidth of the template image in pixels to size work buffers to.
tplHeightHeight of the template image in pixels to size work buffers to.

◆ ImageCrossCorrelation() [3/4]

template<typename T , size_t C>
blo::ImageCrossCorrelation< T, C >::ImageCrossCorrelation ( const ImageCrossCorrelation< T, C > &  rhs)

Copy constructor.

◆ ImageCrossCorrelation() [4/4]

template<typename T , size_t C>
blo::ImageCrossCorrelation< T, C >::ImageCrossCorrelation ( ImageCrossCorrelation< T, C > &&  rhs)
noexcept

Move constructor.

◆ ~ImageCrossCorrelation()

template<typename T , size_t C>
virtual blo::ImageCrossCorrelation< T, C >::~ImageCrossCorrelation ( )
virtual

Destructor.

Member Function Documentation

◆ calcCrossCorrelation()

template<typename T , size_t C>
void blo::ImageCrossCorrelation< T, C >::calcCrossCorrelation ( const T *  pSrc,
int  srcStep,
int  srcRoiWidth,
int  srcRoiHeight,
const T *  pTpl,
int  tplStep,
int  tplRoiWidth,
int  tplRoiHeight,
float *  pDst,
int  dstStep 
)

Calculates the cross-correlation between an image and a template.

This function calculates the cross-correlation between an image and a template using a specified method. The assumed zero-padding of the source image and the size of the destination image is determined by the shape parameter.

Parameters
pSrcPointer to the source image.
srcStepStep in bytes between the rows in the source image.
srcRoiWidthWidth of the source image ROI in pixels.
srcRoiHeightHeight of the source image ROI in pixels.
pTplPointer to the template image.
tplStepStep in bytes between the rows in the template image.
tplRoiWidthWidth of the template image ROI in pixels.
tplRoiHeightHeight of the template image ROI in pixels.
pDstPointer to the destination image.
dstStepStep in bytes between the rows in the destination image.

◆ clear()

template<typename T , size_t C>
void blo::ImageCrossCorrelation< T, C >::clear ( )

Resizes work buffers to zero width and zero height.

◆ method()

template<typename T , size_t C>
Method blo::ImageCrossCorrelation< T, C >::method ( ) const

Retrieves cross-correlation method.

Returns
Cross-correlation method.

◆ operator=() [1/2]

template<typename T , size_t C>
ImageCrossCorrelation & blo::ImageCrossCorrelation< T, C >::operator= ( const ImageCrossCorrelation< T, C > &  rhs)

Copy assignment operator.

◆ operator=() [2/2]

template<typename T , size_t C>
ImageCrossCorrelation & blo::ImageCrossCorrelation< T, C >::operator= ( ImageCrossCorrelation< T, C > &&  rhs)
noexcept

Move assignment operator.

◆ resize()

template<typename T , size_t C>
void blo::ImageCrossCorrelation< T, C >::resize ( int  srcWidth,
int  srcHeight,
int  tplWidth,
int  tplHeight 
)

Resizes work buffers.

Parameters
srcWidthWidth of the source image in pixels to size work buffers to.
srcHeightHeight of the source image in pixels to size work buffers to.
tplWidthWidth of the template image in pixels to size work buffers to.
tplHeightHeight of the template image in pixels to size work buffers to.

◆ setMethod()

template<typename T , size_t C>
void blo::ImageCrossCorrelation< T, C >::setMethod ( Method  method)

Sets cross-correlation method.

Parameters
methodCross-correlation method.

◆ setShape()

template<typename T , size_t C>
void blo::ImageCrossCorrelation< T, C >::setShape ( Shape  shape)

Sets shape parameter.

Parameters
shapeShape parameter.

◆ shape()

template<typename T , size_t C>
Shape blo::ImageCrossCorrelation< T, C >::shape ( ) const

Retrieves shape parameter.

Returns
Shape parameter.

Friends And Related Function Documentation

◆ ImageCrossCorrelation< float, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< float, 1 >
related

◆ ImageCrossCorrelation< float, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< float, 3 >
related

◆ ImageCrossCorrelation< uint16_t, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint16_t, 1 >
related

◆ ImageCrossCorrelation< uint16_t, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint16_t, 3 >
related

◆ ImageCrossCorrelation< uint8_t, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint8_t, 1 >
related

◆ ImageCrossCorrelation< uint8_t, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageCrossCorrelation< uint8_t, 3 >
related

The documentation for this class was generated from the following file: