CSurf Class Reference

Seguidor de puntos usando el método SURF. More...

#include <surf.h>

List of all members.

Public Member Functions

 CSurf ()
 ~CSurf ()
double block (int x, int y, int h, int w, IplImage *I)
 Calculates bloc filter using integral images.
double wl_vert (int x, int y, int s)
double wl_horz (int x, int y, int s)
float orientation (int x, int y, int s)
int * descriptor (int x, int y, int s, float dir)
 this function calculates the surf-64 descriptor for a given feature
float horiz (int x, int y, int s, IplImage *region)
float vert (int x, int y, int s, IplImage *region)
void non_max_sup (double *det, IplImage **max, CvSeq *feat, int levels)
void find_features (IplImage *img, CvSeq *feat, int levels)
 extract surf features from an image
int nearest_neighbor_classify (int *query, int *example_pairs, int n_examples)
 simple nearest neightbour classifier
void gaussian (IplImage *img)

Public Attributes

IplImage * img
IplImage * integral
int det_thres
double cur_thres


Detailed Description

Seguidor de puntos usando el método SURF.

Author:
Jorge Artieda
This class implements a scale and rotation inveriant interest point detector and descriptor. The implementation is based on de paper "SURF: Speeded Up Robust Features" written by Herbert Bay et al. from ETH Zurich and Katholieke Universitet Leuven. A it is stated on the abstract of this paper SURF DETECTOR "Approximates or even outperforms previously proposed schemes with respect to repeatability, distinctiveness, and robustness, yet can be computed an compared much faster. This is achieved by ralying on integral images for image convolutions; by building on th strengths of the leading exiting detectors and descriptors (in casu, using a Hessian matrix-based measure for the detector , and a distribution-based descriptor); an dby simplifying these methods to the esential. This leads to a combination of novel detection description, and matching steps."


Constructor & Destructor Documentation

CSurf::CSurf (  ) 

constructor. Initializes thresholds

CSurf::~CSurf (  ) 

Destructor. Do nothing


Member Function Documentation

double CSurf::block ( int  x,
int  y,
int  h,
int  w,
IplImage *  I 
)

Calculates bloc filter using integral images.

Parameters:
x x coordinate of the upper left pixel of the block
y y coordinate of the upper left pixel of the block
h height of the block
w width of the block
I integral image
This function calculates the sum of the values contained in the the rectangle defined by x,y,w and h. The algorithm is based on integral images that can be calculated using cvIntegral function.
Returns:
sum of all the pixels in the block

float CSurf::orientation ( int  x,
int  y,
int  s 
)

a repeteable orientation for a given feature

Parameters:
x x coordinate of the feature
y y cooredinate of the feature
s scale at which the feature was found
This function estimates an orientatio that is repeteable. This orientation is used to get orientation invariance of the features. The algorithm first estimate vertical and horizontal haar wavelet response using integral images. Then the orientation is calculed as the greater sum of orientations in a sliding window of angle pi/3
Returns:
orientation of the feature in radians

int * CSurf::descriptor ( int  x,
int  y,
int  s,
float  dir 
)

this function calculates the surf-64 descriptor for a given feature

Parameters:
x x coordinate
y y coordinate
s scale of the feature
dir orientation of the feature This function calcualtes the surf-64 descritpor for a feature at the given position scale and orientation.

First a square of size 20*s x 20*s is extracted with the given orientation

Then dx and dy responses are calculated using haar wavelets of size 2*s

Finally the descriptor is calculated as the sum of dx, dy, |dx| and |dy| responses in each of the 16 squares of a 4 by 4 grid sampled int 5*s grid.

void CSurf::non_max_sup ( double *  det,
IplImage **  max,
CvSeq *  feat,
int  levels 
)

non maximum suppression

Parameters:
det array containing the information of the hessian determinant at several levels
max not used
feat sequence of featrues returned
levels number of piramid levels The maximum is searched in a 3 x 3 x 3 neightbourhood

the maximum is accepted if det[] is greater than det_thres and the ratio between the maximum and the second bigger is greater than cur_thres

void CSurf::find_features ( IplImage *  img,
CvSeq *  feat,
int  levels 
)

extract surf features from an image

Parameters:
img image
feat sequence of returned features
levels number of levels of the pyramid. This funcion extracts surf features from an image. Function is based on Integral images to improve the performance of the filters.

int CSurf::nearest_neighbor_classify ( int *  query,
int *  example_pairs,
int  n_examples 
)

simple nearest neightbour classifier

Parameters:
query vector of 64 integer to classify
example_pairs vector of 64*samples in which the query vectors are classified
n_examples number fo samples in example_pairs vector This function is a simple classifier based on the euclidean distance. Best match is the one with less distance to the samples.
Returns:
the number of the category or -1 if it's not found.

If a result has a distance less than 15000 and a ratio between the minimum distance and the second best greater than 0.9 the point is rejected as not found


The documentation for this class was generated from the following files:
Generated on Mon Mar 10 15:26:04 2008 by  doxygen 1.5.2