siftpp.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_CLASSIFIERS_SIFTPP_H_
00025 #define __FIREVISION_CLASSIFIERS_SIFTPP_H_
00026
00027 #ifndef HAVE_SIFTPP
00028 # error SIFTPP not available, you may not use the SiftppClassifier
00029 #endif
00030
00031 #include <vector>
00032 #include <utils/time/clock.h>
00033 #include <utils/time/tracker.h>
00034
00035 #include <classifiers/classifier.h>
00036
00037
00038 #include <siftpp/sift.hpp>
00039
00040
00041
00042 class fawkes::TimeTracker;
00043
00044
00045 namespace firevision {
00046 #if 0
00047 }
00048 #endif
00049
00050 class SiftppClassifier : public Classifier
00051 {
00052 public:
00053 SiftppClassifier(const char * features_file,
00054 int samplingStep = 2,
00055 int octaves = 4,
00056 int levels = 3,
00057 float magnif = 3.0,
00058 int noorient = 0,
00059 int unnormalized = 0);
00060
00061 virtual ~SiftppClassifier();
00062
00063 virtual std::list< ROI > * classify();
00064
00065
00066 struct Feature {
00067 VL::Sift::Keypoint key;
00068 int number_of_desc;
00069 VL::float_t ** descs;
00070 };
00071
00072 private:
00073
00074
00075 int findMatch(const Feature & ip1, const std::vector< Feature > & ipts);
00076
00077
00078
00079 double distSquare(VL::float_t *v1, VL::float_t *v2, int n);
00080
00081
00082 VL::PgmBuffer *__obj_img;
00083 std::vector< Feature > __obj_features;
00084 int __obj_num_features;
00085
00086
00087 VL::PgmBuffer *__image;
00088 std::vector< Feature > __img_features;
00089 int __img_num_features;
00090
00091
00092 int __samplingStep;
00093
00094 int __octaves;
00095
00096 int __levels;
00097
00098 VL::float_t __threshold;
00099 VL::float_t __edgeThreshold;
00100
00101 int __first;
00102
00103
00104
00105 float __sigman;
00106 float __sigma0;
00107
00108
00109 float __magnif;
00110
00111 int __noorient;
00112
00113 int __unnormalized;
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 int __vlen;
00125
00126
00127 fawkes::TimeTracker *__tt;
00128 unsigned int __loop_count;
00129 unsigned int __ttc_objconv;
00130 unsigned int __ttc_objfeat;
00131 unsigned int __ttc_imgconv;
00132 unsigned int __ttc_imgfeat;
00133 unsigned int __ttc_matchin;
00134 unsigned int __ttc_roimerg;
00135
00136
00137 };
00138
00139 }
00140
00141 #endif