61 typedef std::vector<SurfFeature>
IpVec;
102 void Run(
IpVec *ipts,
int clusters,
bool init =
false);
105 void SetIpoints(
IpVec *ipts);
108 void InitRandomClusters(
int n);
111 bool AssignToClusters();
114 void RepositionClusters();
136 assert(width > 0 && height > 0);
139 this->height = height;
143 responses =
new float[width*height];
144 laplacian =
new unsigned char[width*height];
146 memset(responses,0,
sizeof(
float)*width*height);
147 memset(laplacian,0,
sizeof(
unsigned char)*width*height);
151 if (responses)
delete [] responses;
152 if (laplacian)
delete [] laplacian;
155 inline unsigned char getLaplacian(
unsigned int row,
unsigned int column)
157 return laplacian[row * width + column];
165 assert(src->getCoords(row, column) == this->getCoords(
scale * row,
scale * column));
168 return laplacian[(
scale * row) * width + (
scale * column)];
173 return responses[row * width + column];
181 assert(src->getCoords(row, column) == this->getCoords(
scale * row,
scale * column));
184 return responses[(
scale * row) * width + (
scale * column)];
188 std::vector<std::pair<int, int>> coords;
190 inline std::pair<int,int> getCoords(
unsigned int row,
unsigned int column)
192 return coords[row * width + column];
195 inline std::pair<int,int> getCoords(
unsigned int row,
unsigned int column, ResponseLayer *src)
197 int scale = this->width / src->width;
198 return coords[(
scale * row) * width + (
scale * column)];
209 Surf(IplImage *img, std::vector<Ipoint> &ipts);
212 void getDescriptors(
bool bUpright =
false);
217 void getOrientation();
220 void getDescriptor(
bool bUpright =
false);
223 inline float gaussian(
int x,
int y,
float sig);
224 inline float gaussian(
float x,
float y,
float sig);
227 inline float haarX(
int row,
int column,
int size);
228 inline float haarY(
int row,
int column,
int size);
231 float getAngle(
float X,
float Y);
251 std::vector<Ipoint> &ipts,
252 bool upright =
false,
256 float thres =
THRES );
260 std::vector<Ipoint> &ipts,
264 float thres =
THRES );
268 std::vector<Ipoint> &ipts,
269 bool upright =
false);
309 inline int fRound(
float flt) {
return (
int) floor(flt+0.5f); }
ICLCV_API void surfDes(IplImage *img, std::vector< Ipoint > &ipts, bool upright=false)
Library function describes interest points in vector.
Surf Feation class.
Definition: OpenSurfLib.h:204
IpVec clusters
Vector stores cluster centers.
Definition: OpenSurfLib.h:123
ICLCV_API float BoxIntegral(IplImage *img, int row, int col, int rows, int cols)
Computes the sum of pixels within the rectangle.
undocument this line if you encounter any issues!
Definition: Any.h:37
static const float THRES
Definition: OpenSurfLib.h:246
ICLCV_API void showImage(const IplImage *img)
Show the provided image and wait for keypress.
IplImage * img
Integral image where Ipoints have been detected.
Definition: OpenSurfLib.h:235
ICLCV_API int translateCorners(IpPairVec &matches, const CvPoint src_corners[4], CvPoint dst_corners[4])
ICLCV_API IplImage * Integral(IplImage *img)
Computes the integral image of image img. Assumes source image to be a.
ICLCV_API void getMatches(IpVec &ipts1, IpVec &ipts2, IpPairVec &matches)
IpVec & ipts
Ipoints vector.
Definition: OpenSurfLib.h:238
ICLCV_API void saveSurf(char *filename, std::vector< Ipoint > &ipts)
Save the SURF features to file.
ICLCV_API void drawPoints(IplImage *img, std::vector< Ipoint > &ipts)
Draw a Point at all features.
static const int OCTAVES
Definition: OpenSurfLib.h:244
Response Layer class.
Definition: OpenSurfLib.h:128
float * responses
Definition: OpenSurfLib.h:132
SurfFeature Ipoint
Definition: OpenSurfLib.h:60
ICLCV_API void drawIpoint(IplImage *img, Ipoint &ipt, int tailSize=0)
Draw a single feature on the image.
static const int INTERVALS
Definition: OpenSurfLib.h:245
IpVec * ipts
Vector stores ipoints for this run.
Definition: OpenSurfLib.h:120
#define ICLCV_API
Definition: CompatMacros.h:177
static const int INIT_SAMPLE
Definition: OpenSurfLib.h:247
std::vector< SurfFeature > IpVec
Definition: OpenSurfLib.h:61
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
unsigned char getLaplacian(unsigned int row, unsigned int column)
Definition: OpenSurfLib.h:155
int width
Definition: OpenSurfLib.h:131
ICLCV_API void drawWindows(IplImage *img, std::vector< Ipoint > &ipts)
Draw descriptor windows around Ipoints in the provided vector.
Kmeans clustering.
Definition: OpenSurfLib.h:92
unsigned char * laplacian
Definition: OpenSurfLib.h:133
Generic SURF Feature type.
Definition: SurfFeature.h:42
ICLCV_API IplImage * getGray(const IplImage *img)
ICLCV_API void drawPoint(IplImage *img, Ipoint &ipt)
Draw a Point at feature location.
ICLCV_API void surfDet(IplImage *img, std::vector< Ipoint > &ipts, int octaves=OCTAVES, int intervals=INTERVALS, int init_sample=INIT_SAMPLE, float thres=THRES)
Library function builds vector of interest points.
ICLCV_API void error(const char *msg)
Display error message and terminate program.
float getResponse(unsigned int row, unsigned int column)
Definition: OpenSurfLib.h:171
ICLCV_API void drawIpoints(IplImage *img, std::vector< Ipoint > &ipts, int tailSize=0)
Draw all the Ipoints in the provided vector.
static void scale(const int deg, xcomplex *P)
Definition: PolynomialSolver.h:133
~ResponseLayer()
Definition: OpenSurfLib.h:150
unsigned char getLaplacian(unsigned int row, unsigned int column, ResponseLayer *src)
Definition: OpenSurfLib.h:160
std::vector< SurfMatch > IpPairVec
Definition: OpenSurfLib.h:62
~Kmeans()
Destructor.
Definition: OpenSurfLib.h:96
Kmeans()
Constructor.
Definition: OpenSurfLib.h:99
ICLCV_API void drawFPS(IplImage *img)
ICLCV_API void surfDetDes(IplImage *img, std::vector< Ipoint > &ipts, bool upright=false, int octaves=OCTAVES, int intervals=INTERVALS, int init_sample=INIT_SAMPLE, float thres=THRES)
Library function builds vector of described interest points.
float getResponse(unsigned int row, unsigned int column, ResponseLayer *src)
Definition: OpenSurfLib.h:176
int fRound(float flt)
Round float to nearest integer.
Definition: OpenSurfLib.h:309
ResponseLayer(int width, int height, int step, int filter)
Definition: OpenSurfLib.h:135
int index
Index of current Ipoint in the vector.
Definition: OpenSurfLib.h:241
ICLCV_API void loadSurf(char *filename, std::vector< Ipoint > &ipts)
Load the SURF features from file.