Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::RegionMatcher Class Reference

Basic functions for CornerMatcher. More...

#include <Matcher2D/RegionMatcher.hh>

+ Inheritance diagram for BIAS::RegionMatcher:
+ Collaboration diagram for BIAS::RegionMatcher:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
template<class StorageType >
void CNCC (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 ColorNCC for interleaved hsL images. More...
 
template<class StorageType >
void ColorCCV (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 computes the Cross-CoVariance ,which is equal to NCC but does no variance(contrast) normailzation More...
 
template<class StorageType >
void ColorNCC (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 ColorNCC for interleaved HSV images. More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
template<class StorageType >
void HammingDistance (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, const unsigned int censussize, double &result) const
 fast hamming distance between p1 and p2 without boundary checking. More...
 
template<>
BIASMatcher2D_EXPORT void HammingDistance (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, const unsigned int censussize, double &result) const
 
template<class StorageType >
int LineMatcherNCC (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &correlation) const
 
template<class StorageType >
int LineMatcherNCC (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &correlation) const
 
           find correspondence to p1 from ida1 in ida2

at aproximate starting position p2 using KLT algorithm: More...

 
template<class StorageType >
int LineMatcherSAD (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &sad) const
 
template<class StorageType >
int LineMatcherSAD (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &sad) const
 as above but uses SAD More...
 
template<class StorageType >
int LineMatcherSSD (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &ssd) const
 
template<class StorageType >
int LineMatcherSSD (const unsigned int p1[2], const unsigned int start2[2], const unsigned int end2[2], const StorageType **ida1, const StorageType **ida2, const StorageType **grad1, const StorageType **grad2, const unsigned int halfwinsize, const unsigned int epsilon, const double gradientscale, unsigned int result[2], double &ssd) const
 as above but uses SSD More...
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
template<>
BIASMatcher2D_EXPORT void NCC (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, double &result) const
 
template<class StorageType >
void NCC (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 fast ncc between p1 and p2 without boundary checking Faster specialisation for unsigned char exists because of integer arithmetic Specialisation for unsigned char does work without overflow with halfwindowsizes <= 127 if sizeof(unsigned char)=1 and sizeof(unsigned long int)=4 More...
 
template<class StorageType >
void NCC (const double p1[2], const double p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned halfwinsize, double &result)
 fast interpolated ncc More...
 
template<class StorageType >
void NCC (const unsigned p1[2], const unsigned p2[2], const StorageType **ida1, const StorageType **roi1, const StorageType **ida2, const StorageType **roi2, const unsigned hww, const unsigned hwh, double &result) const
 fast ncc between p1 in ida1 and p2 in ida2 the correlation is calculated in a window of width=2*hww+1 and height = 2*hwh+1 only those pixels within the window are used, where the according roi is not zero More...
 
template<class StorageType >
int NCCSearchEven (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfnccwinsize, const unsigned int halfsearchwinsize, unsigned int resultpoint[2], const double mincorrelation, double &result) const
 As above but middle point of searchwindow is p1[0]+0.5, p1[1]+0.5 Searchwindow is always even-sized floor(p2[i]+0.5+-halfsearchwinsize) More...
 
template<class StorageType >
int NCCSearchOdd (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfnccwinsize, const unsigned int halfsearchwinsize, unsigned int resultpoint[2], const double mincorrelation, double &result) const
 Searches in a window around p2 [p2[i]+-halfsearchwinsize] for a point with correlation > mincorrelation. More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
template<class StorageType >
int ParabolaNCC (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, KLT_TYPE result[2]) const
 function to achieve sub-pixel accuracy if p1 and p2 are corresponding image points from ida1 resp ida2 exact parabola approximation with 3 values is used no boundary checks, p1 and p2 must be further than halfwinsize+1 from array border correlation between p1 and p2 must be a local discrete maximum i.e. More...
 
template<class StorageType >
int ParabolaNCC5 (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, KLT_TYPE result[2]) const
 function to achieve sub-pixel accuracy if p1 and p2 are corresponding image points from ida1 resp ida2 over-determined parabola approximation with 5 values is used no boundary checks, p1 and p2 must be further than halfwinsize+2 from array border correlation between p1 and p2 must be a local discrete maximum i.e. More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
 RegionMatcher ()
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
template<>
BIASMatcher2D_EXPORT void SAD (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, double &result) const
 
template<class StorageType >
void SAD (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned halfwinsize, const unsigned channel_count, double &result) const
 
template<>
BIASMatcher2D_EXPORT void SAD (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned halfwinsize, const unsigned channel_count, double &result) const
 
template<class StorageType >
void SAD (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 fast sum of absolut differences (SAD) sim. More...
 
template<class StorageType >
void SAD (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, const unsigned channel_count, double &result) const
 fast sum of absolut differences (SAD) sim. More...
 
template<>
BIASMatcher2D_EXPORT void SADN (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, double &result) const
 
template<class StorageType >
void SADN (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 'normalized' version of SAD, returns 1.0 incase of no differences 0.0 in case of max difference specialized version for unsigned char exist only for halfwindowsizes < 2050 More...
 
template<class StorageType >
void SADSamplingInsensitive (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 
template<>
BIASMatcher2D_EXPORT void SADSamplingInsensitive (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, double &result) const
 
template<class StorageType >
void SamplingInsensitiveDissimilarity (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, double &result) const
 calculates sampling insensitive dissimilarity measure (birchfield, tomasi) More...
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
template<>
BIASMatcher2D_EXPORT void SSD (const unsigned int p1[2], const unsigned int p2[2], const unsigned char **ida1, const unsigned char **ida2, const unsigned int halfwinsize, double &result) const
 
template<class StorageType >
void SSD (const unsigned int p1[2], const unsigned int p2[2], const StorageType **ida1, const StorageType **ida2, const unsigned int halfwinsize, double &result) const
 fast sum of square differences (SSD) sim. More...
 
 ~RegionMatcher ()
 

Static Public Member Functions

template<class StorageType >
static float AD (const unsigned int x1, const unsigned int y1, BIAS::Image< StorageType > &img1, const unsigned int x2, const unsigned int y2, BIAS::Image< StorageType > &img2)
 calculates absolute difference between pixel (x1,y1) in image img1 and (x2,y2) in img2 More...
 
template<class StorageType >
static bool BilinearRegion (const Image< StorageType > &im, const double &x, const double &y, const unsigned hws, Matrix< double > &res)
 Fast bilinear interpolation of a region in grey image. More...
 
template<class StorageType >
static bool BilinearRegionColor (const Image< StorageType > &im, const double &x, const double &y, const unsigned hws, Matrix< double > &res)
 Fast bilinear interpolation of a region in interleaved color image. More...
 
template<class StorageType >
static bool BilinearRegionColor3 (const Image< StorageType > &im, const double &x, const double &y, const unsigned hws, Matrix< double > &res)
 Fast bilinear interpolation of a region in interleaved color image. More...
 
static long int GetGlobalDebugLevel ()
 
template<class StorageType >
static bool LinearRegionX (const Image< StorageType > &im, const double &x, const unsigned &y, const unsigned hws, Matrix< double > &res)
 Fast linear interpolation of a region in the image, untested. More...
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

template<class StorageType >
KLT_TYPE _Bilinear (const StorageType **ida, const KLT_TYPE x, const KLT_TYPE y) const
 
KLT_TYPE _Bilinear (const unsigned char **ida, const KLT_TYPE x, const KLT_TYPE y) const
 
template<class StorageType >
void _BilinearRegion (const StorageType **ida, const KLT_TYPE x, const KLT_TYPE y, const unsigned hws, Matrix< KLT_TYPE > &res) const
 bilinear interpolation, also moved gradient image data from [0:255] to [-127, 128] before interpolating More...
 
void _BilinearRegion (const unsigned char **ida, const KLT_TYPE x, const KLT_TYPE y, const unsigned hws, Matrix< KLT_TYPE > &res) const
 
KLT_TYPE _ParabolaApprox (const KLT_TYPE x1, const KLT_TYPE x2, const KLT_TYPE x3) const
 bilinear interpolation, also moved gradient image data from [0:255] to [-127, 128] before interpolating More...
 
KLT_TYPE _ParabolaApprox (const KLT_TYPE x1, const KLT_TYPE x2, const KLT_TYPE x3, const KLT_TYPE x4, const KLT_TYPE x5) const
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 

Protected Attributes

Matrix< KLT_TYPE > _bl1
 
Matrix< KLT_TYPE > _bl1_5
 
Matrix< KLT_TYPE > _bl2
 
Matrix< KLT_TYPE > _bl2_5
 
Vector2< KLT_TYPE > _d
 
Vector2< KLT_TYPE > _disp
 
Vector2< KLT_TYPE > _e
 
Matrix2x2< KLT_TYPE > _G
 
Matrix2x2< KLT_TYPE > _Ginv
 
Matrix< KLT_TYPE > _gsx
 
Matrix< KLT_TYPE > _gsx_5
 
Matrix< KLT_TYPE > _gsy
 
Matrix< KLT_TYPE > _gsy_5
 
Matrix< KLT_TYPE > _gx
 
Matrix< KLT_TYPE > _gx1
 
Matrix< KLT_TYPE > _gx1_5
 
Matrix< KLT_TYPE > _gx2
 
Matrix< KLT_TYPE > _gx2_5
 
Matrix< KLT_TYPE > _gy
 
Matrix< KLT_TYPE > _gy1
 
Matrix< KLT_TYPE > _gy1_5
 
Matrix< KLT_TYPE > _gy2
 
Matrix< KLT_TYPE > _gy2_5
 
Matrix< KLT_TYPE > _iim1
 
Matrix< KLT_TYPE > _iim2
 
unsigned _klthws
 
long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
unsigned _ncchws
 
unsigned _nccwinsize
 
std::map< std::string, long int > _String2Debuglevel
 
unsigned _winsize
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

Basic functions for CornerMatcher.

class that holds sum of square diffeences (ssd), normalized cross correlation (ncc) and KLT and parabola interpolation for a convenient interface working with HomgPoint2D doing boundary checks use CornerMatcher

Author
Felix Woelk
Examples:
ExampleColorNCC.cpp, and ExampleLineMatcher.cpp.

Definition at line 151 of file RegionMatcher.hh.

Constructor & Destructor Documentation

RegionMatcher::RegionMatcher ( )
RegionMatcher::~RegionMatcher ( )

Definition at line 46 of file RegionMatcher.cpp.

Member Function Documentation

template<class StorageType >
KLT_TYPE RegionMatcher::_Bilinear ( const StorageType **  ida,
const KLT_TYPE  x,
const KLT_TYPE  y 
) const
protected

Definition at line 451 of file RegionMatcher.cpp.

KLT_TYPE RegionMatcher::_Bilinear ( const unsigned char **  ida,
const KLT_TYPE  x,
const KLT_TYPE  y 
) const
protected

Definition at line 467 of file RegionMatcher.cpp.

template<class StorageType >
void RegionMatcher::_BilinearRegion ( const StorageType **  ida,
const KLT_TYPE  x,
const KLT_TYPE  y,
const unsigned  hws,
Matrix< KLT_TYPE > &  res 
) const
protected

bilinear interpolation, also moved gradient image data from [0:255] to [-127, 128] before interpolating

Definition at line 497 of file RegionMatcher.cpp.

void RegionMatcher::_BilinearRegion ( const unsigned char **  ida,
const KLT_TYPE  x,
const KLT_TYPE  y,
const unsigned  hws,
Matrix< KLT_TYPE > &  res 
) const
protected

Definition at line 520 of file RegionMatcher.cpp.

KLT_TYPE BIAS::RegionMatcher::_ParabolaApprox ( const KLT_TYPE  x1,
const KLT_TYPE  x2,
const KLT_TYPE  x3 
) const
inlineprotected

bilinear interpolation, also moved gradient image data from [0:255] to [-127, 128] before interpolating

Definition at line 587 of file RegionMatcher.hh.

Referenced by ParabolaNCC(), and ParabolaNCC5().

KLT_TYPE BIAS::RegionMatcher::_ParabolaApprox ( const KLT_TYPE  x1,
const KLT_TYPE  x2,
const KLT_TYPE  x3,
const KLT_TYPE  x4,
const KLT_TYPE  x5 
) const
inlineprotected

Definition at line 597 of file RegionMatcher.hh.

References Lapack_LLS_QR_linear_solve().

template<class StorageType >
float RegionMatcher::AD ( const unsigned int  x1,
const unsigned int  y1,
BIAS::Image< StorageType > &  img1,
const unsigned int  x2,
const unsigned int  y2,
BIAS::Image< StorageType > &  img2 
)
static

calculates absolute difference between pixel (x1,y1) in image img1 and (x2,y2) in img2

Author
frick

Definition at line 717 of file RegionMatcher.cpp.

References BIAS::Image< StorageType >::PixelValue().

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

template<class StorageType >
bool RegionMatcher::BilinearRegion ( const Image< StorageType > &  im,
const double &  x,
const double &  y,
const unsigned  hws,
Matrix< double > &  res 
)
static

Fast bilinear interpolation of a region in grey image.

Author
woelk 12/2007 (c) www.vision-n.de

Definition at line 146 of file RegionMatcher.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), and TNT::Matrix< T >::newsize().

Referenced by BilinearRegionColor().

template<class StorageType >
bool RegionMatcher::BilinearRegionColor ( const Image< StorageType > &  im,
const double &  x,
const double &  y,
const unsigned  hws,
Matrix< double > &  res 
)
static

Fast bilinear interpolation of a region in interleaved color image.

Author
woelk 12/2007 (c) www.vision-n.de

Definition at line 50 of file RegionMatcher.cpp.

References BilinearRegion(), BilinearRegionColor3(), and BIAS::ImageBase::GetChannelCount().

template<class StorageType >
bool RegionMatcher::BilinearRegionColor3 ( const Image< StorageType > &  im,
const double &  x,
const double &  y,
const unsigned  hws,
Matrix< double > &  res 
)
static

Fast bilinear interpolation of a region in interleaved color image.

Author
woelk 12/2007 (c) www.vision-n.de

Definition at line 107 of file RegionMatcher.cpp.

References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsInterleaved(), and TNT::Matrix< T >::newsize().

Referenced by BilinearRegionColor().

template<class StorageType >
void BIAS::RegionMatcher::CNCC ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

ColorNCC for interleaved hsL images.

Author
Daniel Grest, June 2003
Examples:
ExampleColorNCC.cpp.

Definition at line 439 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::ColorCCV ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

computes the Cross-CoVariance ,which is equal to NCC but does no variance(contrast) normailzation

Author
Daniel Grest, April 2003

Definition at line 310 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::ColorNCC ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

ColorNCC for interleaved HSV images.

Author
Daniel Grest, March 2003

Definition at line 364 of file SimilarityMeasure.cpp.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

template<class StorageType >
void BIAS::RegionMatcher::HammingDistance ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
const unsigned int  censussize,
double &  result 
) const

fast hamming distance between p1 and p2 without boundary checking.

parameter censussize is number of channels in which census information is stored.

Author
fkellner

Definition at line 511 of file SimilarityMeasure.cpp.

template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::HammingDistance ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
const unsigned int  censussize,
double &  result 
) const

Definition at line 519 of file SimilarityMeasure.cpp.

template<class StorageType >
bool RegionMatcher::LinearRegionX ( const Image< StorageType > &  im,
const double &  x,
const unsigned &  y,
const unsigned  hws,
Matrix< double > &  res 
)
static

Fast linear interpolation of a region in the image, untested.

Author
woelk 01/2008 (c) www.vision-n.de

Definition at line 179 of file RegionMatcher.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and TNT::Matrix< T >::newsize().

template<class StorageType >
int BIAS::RegionMatcher::LineMatcherNCC ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  correlation 
) const

Definition at line 27 of file LineMatcher.cpp.

References BIAS::Scanline::GetNext().

template<class StorageType >
int BIAS::RegionMatcher::LineMatcherNCC ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  correlation 
) const

           find correspondence to p1 from ida1 in ida2

at aproximate starting position p2 using KLT algorithm:

Solve G * d = e with

G = | sum(gx*gx) sum(gx*gy) | , and | sum(gx*gy) sum(gy*gy) |

e = | sum(gx*(I2-I1)) sum(gy*(I2-I1)) |^T

sums are over the window, gx is x-gradient and gy the y-gradient in first image, I1 and I2 are the grey values in the first resp. the second image iterate numiterations times !!! no initial boundary checks is performed in this algorithm !!! returns 0 on success returns -1 if point slids out of [0, with][0, height] modulo halfwinsize output: result - image coo of p1 in im2 error - norm(e) input : p1 - location of feature point in image1 p2 - aproximate location of same feature point in new image 2 could be set to p1 featurepoint is not moving a lot ida1 - pointer to the image data (row major) of first image ida2 - pointer to the image data (row major) of new image gradx - pointer to the x-gradient data of image1 grady - pointer to the y-gradient data of image1 halfwinsize - the window to use numiterations - number of iterations to do width - width of StorageType Arrays height - height of StorageType Array ida1[height-1][with-1] is the maximal allowed acces to the arrays

Author
fw same as KLT above but do it until either maxiterations is reached or the error is dropping below maxerror as above but uses the averaged gradient of the 2 images same as above but also returns the number of iterations used as above but uses a 5x5 window
woelk 08 2003 searches only perpendicular to the dominating edge, i.e. parallel to the dominating gradient the search direction is discretized in 4 different directions the discretization-error of direction is max 22 deg which accounts to 7% of length error decides which KLT_? to use
woelk 08 2003 searches along line from start2 to end2 within +/- epsilon pixels away from the line in ida2 for a match to p1 using ncc with halfwinsize boundary checking is not done, i.e. start2 and end2 must lie more than halfwindowsize+epsilon away from the image border p1 must lie more than halfwinsize away from image border only for those points in im2 a correlation is calculated for which the gradient is > grad1[p1[1]][p1[0]]*gradientscale input: ida1 - pointer to the image data array of im1, row mayor

output: result - image coo of point with greatest corelation correlation - the correlation betwen p1 and result returns: 0 on success -1 no matching point found <-1 error

Examples:
ExampleLineMatcher.cpp.
template<class StorageType >
int BIAS::RegionMatcher::LineMatcherSAD ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  sad 
) const

Definition at line 73 of file LineMatcher.cpp.

References BIAS::Scanline::GetNext().

template<class StorageType >
int BIAS::RegionMatcher::LineMatcherSAD ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  sad 
) const

as above but uses SAD

Examples:
ExampleLineMatcher.cpp.
template<class StorageType >
int BIAS::RegionMatcher::LineMatcherSSD ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  ssd 
) const

Definition at line 117 of file LineMatcher.cpp.

References BIAS::Scanline::GetNext().

template<class StorageType >
int BIAS::RegionMatcher::LineMatcherSSD ( const unsigned int  p1[2],
const unsigned int  start2[2],
const unsigned int  end2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const StorageType **  grad1,
const StorageType **  grad2,
const unsigned int  halfwinsize,
const unsigned int  epsilon,
const double  gradientscale,
unsigned int  result[2],
double &  ssd 
) const

as above but uses SSD

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::NCC ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

Definition at line 215 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::NCC ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

fast ncc between p1 and p2 without boundary checking Faster specialisation for unsigned char exists because of integer arithmetic Specialisation for unsigned char does work without overflow with halfwindowsizes <= 127 if sizeof(unsigned char)=1 and sizeof(unsigned long int)=4

Author
woelk
Examples:
ExampleColorNCC.cpp.

Definition at line 187 of file SimilarityMeasure.cpp.

Referenced by BIAS::CornerMatcher::NCC(), NCCSearchEven(), NCCSearchOdd(), ParabolaNCC(), and ParabolaNCC5().

template<class StorageType >
void BIAS::RegionMatcher::NCC ( const double  p1[2],
const double  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned  halfwinsize,
double &  result 
)

fast interpolated ncc

Author
woelk

Definition at line 249 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::NCC ( const unsigned  p1[2],
const unsigned  p2[2],
const StorageType **  ida1,
const StorageType **  roi1,
const StorageType **  ida2,
const StorageType **  roi2,
const unsigned  hww,
const unsigned  hwh,
double &  result 
) const

fast ncc between p1 in ida1 and p2 in ida2 the correlation is calculated in a window of width=2*hww+1 and height = 2*hwh+1 only those pixels within the window are used, where the according roi is not zero

Author
woelk 09 2003 , tested

Definition at line 280 of file SimilarityMeasure.cpp.

template<class StorageType >
int RegionMatcher::NCCSearchEven ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfnccwinsize,
const unsigned int  halfsearchwinsize,
unsigned int  resultpoint[2],
const double  mincorrelation,
double &  result 
) const

As above but middle point of searchwindow is p1[0]+0.5, p1[1]+0.5 Searchwindow is always even-sized floor(p2[i]+0.5+-halfsearchwinsize)

Definition at line 342 of file RegionMatcher.cpp.

References NCC().

Referenced by BIAS::CornerMatcher::NCCSearch(), and BIAS::CornerMatcher::RefinePyramideNCC().

template<class StorageType >
int RegionMatcher::NCCSearchOdd ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfnccwinsize,
const unsigned int  halfsearchwinsize,
unsigned int  resultpoint[2],
const double  mincorrelation,
double &  result 
) const

Searches in a window around p2 [p2[i]+-halfsearchwinsize] for a point with correlation > mincorrelation.

If point with correlation > mincorrelation is found, the search is aborted and resultpoint is set. If no point with correlation > mincorrelation is found, a negative value is returned. resultpoint is set to the point with biggest correlation within search window, result is set tot this correlation. Searching follows an outbound spiral around p2, either until searchwinsize is completly searched or until a point with correlation greater than mincorrelation is found If whole search area should be used, use mincorrelation>=1.0 Searchwindow is always odd-sized (p2+/-halfsearchwinsize) returns 0 on success, negative value if no point found with correlation > mincorrelation !!! warning, no boundary checking is performed, i.e. p1[i]/p2[i] +-(halfnccwinsize+halfsearchwinsize) must lie within StorageType-array input: p1, p2, ida1, ida2, halfnccwinsize, halfsearchwinsize, mincorrelation output: resultpoint, result

Definition at line 237 of file RegionMatcher.cpp.

References NCC().

Referenced by BIAS::CornerMatcher::NCCSearch().

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
template<class StorageType >
int RegionMatcher::ParabolaNCC ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
KLT_TYPE  result[2] 
) const

function to achieve sub-pixel accuracy if p1 and p2 are corresponding image points from ida1 resp ida2 exact parabola approximation with 3 values is used no boundary checks, p1 and p2 must be further than halfwinsize+1 from array border correlation between p1 and p2 must be a local discrete maximum i.e.

NCC(p1, {p2[0]+/-1, p2[1]+/-1})<NCC(p1, p2)

Author
woelk 03 2003

Definition at line 610 of file RegionMatcher.cpp.

References _ParabolaApprox(), and NCC().

Referenced by BIAS::CornerMatcher::ParabolaNCC().

template<class StorageType >
int RegionMatcher::ParabolaNCC5 ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
KLT_TYPE  result[2] 
) const

function to achieve sub-pixel accuracy if p1 and p2 are corresponding image points from ida1 resp ida2 over-determined parabola approximation with 5 values is used no boundary checks, p1 and p2 must be further than halfwinsize+2 from array border correlation between p1 and p2 must be a local discrete maximum i.e.

NCC(p1, {p2[0]+/-2, p2[1]+/-2})<NCC(p1, p2)

Author
woelk 04 2003

Definition at line 659 of file RegionMatcher.cpp.

References _ParabolaApprox(), and NCC().

Referenced by BIAS::CornerMatcher::ParabolaNCC5().

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::SAD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

Definition at line 45 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SAD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned  halfwinsize,
const unsigned  channel_count,
double &  result 
) const

Definition at line 63 of file SimilarityMeasure.cpp.

template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::SAD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned  halfwinsize,
const unsigned  channel_count,
double &  result 
) const

Definition at line 83 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SAD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

fast sum of absolut differences (SAD) sim.

measurement between p1 and p2 without boundary checking specialized version for unsigned char exist only for halfwindowsizes < 2050

Author
woelk 02 2003 untested

Definition at line 29 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SAD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
const unsigned  channel_count,
double &  result 
) const

fast sum of absolut differences (SAD) sim.

measurement between p1 and p2 without boundary checking Only for interleavd color images

Author
woelk 02 2008 untested
template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::SADN ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

Definition at line 126 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SADN ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

'normalized' version of SAD, returns 1.0 incase of no differences 0.0 in case of max difference specialized version for unsigned char exist only for halfwindowsizes < 2050

Author
woelk 05 2003 untested

Definition at line 103 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SADSamplingInsensitive ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const
template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::SADSamplingInsensitive ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

Definition at line 537 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SamplingInsensitiveDissimilarity ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
double &  result 
) const

calculates sampling insensitive dissimilarity measure (birchfield, tomasi)

Author
fkellner

Definition at line 559 of file SimilarityMeasure.cpp.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

template<>
BIASMatcher2D_EXPORT void BIAS::RegionMatcher::SSD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const unsigned char **  ida1,
const unsigned char **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

Definition at line 169 of file SimilarityMeasure.cpp.

template<class StorageType >
void BIAS::RegionMatcher::SSD ( const unsigned int  p1[2],
const unsigned int  p2[2],
const StorageType **  ida1,
const StorageType **  ida2,
const unsigned int  halfwinsize,
double &  result 
) const

fast sum of square differences (SSD) sim.

measurment between p1 and p2 without boundary checking specialized version for unsigned char exist for halfwindowsizes <= 127 if sizeof(unsigned char)=1 and sizeof(unsigned long int)=4

Author
woelk ? untested

Definition at line 148 of file SimilarityMeasure.cpp.

Referenced by BIAS::CornerMatcher::SSD().

Member Data Documentation

Matrix<KLT_TYPE> BIAS::RegionMatcher::_bl1
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_bl1_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_bl2
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_bl2_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Vector2<KLT_TYPE> BIAS::RegionMatcher::_d
protected

Definition at line 614 of file RegionMatcher.hh.

Vector2<KLT_TYPE> BIAS::RegionMatcher::_disp
protected

Definition at line 614 of file RegionMatcher.hh.

Vector2<KLT_TYPE> BIAS::RegionMatcher::_e
protected

Definition at line 614 of file RegionMatcher.hh.

Matrix2x2<KLT_TYPE> BIAS::RegionMatcher::_G
protected

Definition at line 613 of file RegionMatcher.hh.

Matrix2x2<KLT_TYPE> BIAS::RegionMatcher::_Ginv
protected

Definition at line 613 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gsx
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gsx_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gsy
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gsy_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gx
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gx1
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gx1_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gx2
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gx2_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gy
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gy1
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gy1_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gy2
protected

Definition at line 615 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_gy2_5
protected

Definition at line 616 of file RegionMatcher.hh.

Referenced by RegionMatcher().

Matrix<KLT_TYPE> BIAS::RegionMatcher::_iim1
protected

Definition at line 620 of file RegionMatcher.hh.

Matrix<KLT_TYPE> BIAS::RegionMatcher::_iim2
protected

Definition at line 620 of file RegionMatcher.hh.

unsigned BIAS::RegionMatcher::_klthws
protected

Definition at line 618 of file RegionMatcher.hh.

Referenced by RegionMatcher().

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

unsigned BIAS::RegionMatcher::_ncchws
protected

Definition at line 621 of file RegionMatcher.hh.

Referenced by RegionMatcher().

unsigned BIAS::RegionMatcher::_nccwinsize
protected

Definition at line 621 of file RegionMatcher.hh.

Referenced by RegionMatcher().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

unsigned BIAS::RegionMatcher::_winsize
protected

Definition at line 618 of file RegionMatcher.hh.

Referenced by RegionMatcher().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.


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