Main MRPT website > C++ reference for MRPT 1.5.9
sift.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #ifndef SIFT_H
11 #define SIFT_H
12 
13 //#include "cxcore.h"
14 // Universal include for all versions of OpenCV
15 #include <mrpt/otherlibs/do_opencv_includes.h>
16 
17 #ifdef __cplusplus
18  extern "C" {
19 #endif
20 
21 /******************************** Structures *********************************/
22 
23 /** holds feature data relevant to detection */
25 {
26  int r;
27  int c;
28  int octv;
29  int intvl;
30  double subintvl;
31  double scl_octv;
32 };
33 
34 struct feature;
35 
36 
37 /******************************* Defs and macros *****************************/
38 
39 /** default number of sampled intervals per octave */
40 #define SIFT_INTVLS 3
41 
42 /** default sigma for initial gaussian smoothing */
43 #define SIFT_SIGMA 1.6
44 
45 /** default threshold on keypoint contrast |D(x)| */
46 //#define SIFT_CONTR_THR 0.04
47 
48 /** default threshold on keypoint ratio of principle curvatures */
49 //#define SIFT_CURV_THR 10
50 
51 /** double image size before pyramid construction? */
52 #define SIFT_IMG_DBL 1
53 
54 /** default width of descriptor histogram array */
55 #define SIFT_DESCR_WIDTH 4
56 
57 /** default number of bins per histogram in descriptor array */
58 #define SIFT_DESCR_HIST_BINS 8
59 
60 /* assumed gaussian blur for input image */
61 #define SIFT_INIT_SIGMA 0.5
62 
63 /* width of border in which to ignore keypoints */
64 #define SIFT_IMG_BORDER 5
65 
66 /* maximum steps of keypoint interpolation before failure */
67 #define SIFT_MAX_INTERP_STEPS 5
68 
69 /* default number of bins in histogram for orientation assignment */
70 #define SIFT_ORI_HIST_BINS 36
71 
72 /* determines gaussian sigma for orientation assignment */
73 #define SIFT_ORI_SIG_FCTR 1.5
74 
75 /* determines the radius of the region used in orientation assignment */
76 #define SIFT_ORI_RADIUS 3.0 * SIFT_ORI_SIG_FCTR
77 
78 /* number of passes of orientation histogram smoothing */
79 #define SIFT_ORI_SMOOTH_PASSES 2
80 
81 /* orientation magnitude relative to max that results in new feature */
82 #define SIFT_ORI_PEAK_RATIO 0.8
83 
84 /* determines the size of a single descriptor orientation histogram */
85 #define SIFT_DESCR_SCL_FCTR 3.0
86 
87 /* threshold on magnitude of elements of descriptor vector */
88 #define SIFT_DESCR_MAG_THR 0.2
89 
90 /* factor used to convert floating-point descriptor to unsigned char */
91 #define SIFT_INT_DESCR_FCTR 512.0
92 
93 /* returns a feature's detection data */
94 #define feat_detection_data(f) ( (struct detection_data*)(f->feature_data) )
95 
96 
97 /*************************** Function Prototypes *****************************/
98 
99 /**
100 Finds SIFT features in an image using default parameter values. All
101 detected features are stored in the array pointed to by \a feat.
102 
103 @param img the image in which to detect features
104 @param feat a pointer to an array in which to store detected features
105 
106 @return Returns the number of features stored in \a feat or -1 on failure
107 @see _sift_features()
108 */
109 extern int sift_features( IplImage* img, struct feature** feat );
110 
111 
112 
113 /**
114 Finda SIFT features in an image using user-specified parameter values. All
115 detected features are stored in the array pointed to by \a feat.
116 
117 @param img the image in which to detect features
118 @param feat a pointer to an array in which to store detected features
119 @param intvls the number of intervals sampled per octave of scale space
120 @param sigma the amount of Gaussian smoothing applied to each image level
121  before building the scale space representation for an octave
122 @param contr_thr a threshold on the value of the scale space function
123  \f$\left|D(\hat{x})\right|\f$, where \f$\hat{x}\f$ is a vector specifying
124  feature location and scale, used to reject unstable features; assumes
125 pixel values in the range [0, 1]
126 @param curv_thr threshold on a feature's ratio of principle curvatures
127  used to reject features that are too edge-like
128 @param img_dbl should be 1 if image doubling prior to scale space
129  construction is desired or 0 if not
130 @param descr_width the width, \f$n\f$, of the \f$n \times n\f$ array of
131  orientation histograms used to compute a feature's descriptor
132 @param descr_hist_bins the number of orientations in each of the
133  histograms in the array used to compute a feature's descriptor
134 
135 @return Returns the number of keypoints stored in \a feat or -1 on failure
136 @see sift_features()
137 */
138 extern int _sift_features( IplImage* img, struct feature** feat, int intvls,
139  double sigma, double contr_thr, int curv_thr,
140  int img_dbl, int descr_width, int descr_hist_bins );
141 
142 
143 #ifdef __cplusplus
144  }
145 #endif
146 
147 #endif
int octv
Definition: sift.h:28
double subintvl
Definition: sift.h:30
int intvl
Definition: sift.h:29
GLint GLvoid * img
Definition: glext.h:3645
holds feature data relevant to detection
Definition: sift.h:24
Structure to represent an affine invariant image feature.
Definition: imgfeatures.h:52
int sift_features(IplImage *img, struct feature **feat)
Finds SIFT features in an image using default parameter values.
double scl_octv
Definition: sift.h:31
int _sift_features(IplImage *img, struct feature **feat, int intvls, double sigma, double contr_thr, int curv_thr, int img_dbl, int descr_width, int descr_hist_bins)
Finda SIFT features in an image using user-specified parameter values.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020