#include <surf.h>
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 |
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."
| CSurf::CSurf | ( | ) |
constructor. Initializes thresholds
| CSurf::~CSurf | ( | ) |
Destructor. Do nothing
| double CSurf::block | ( | int | x, | |
| int | y, | |||
| int | h, | |||
| int | w, | |||
| IplImage * | I | |||
| ) |
Calculates bloc filter using integral images.
| 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 |
| float CSurf::orientation | ( | int | x, | |
| int | y, | |||
| int | s | |||
| ) |
a repeteable orientation for a given feature
| x | x coordinate of the feature | |
| y | y cooredinate of the feature | |
| s | scale at which the feature was found |
| int * CSurf::descriptor | ( | int | x, | |
| int | y, | |||
| int | s, | |||
| float | dir | |||
| ) |
this function calculates the surf-64 descriptor for a given feature
| 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
| 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
| 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
| 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. |
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
1.5.2