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 class SiftppClassifier : public Classifier
00046 {
00047 public:
00048 SiftppClassifier(const char * features_file,
00049 int samplingStep = 2,
00050 int octaves = 4,
00051 int levels = 3,
00052 float magnif = 3.0,
00053 int noorient = 0,
00054 int unnormalized = 0);
00055
00056 virtual ~SiftppClassifier();
00057
00058 virtual std::list< ROI > * classify();
00059
00060
00061 struct Feature {
00062 VL::Sift::Keypoint key;
00063 int number_of_desc;
00064 VL::float_t ** descs;
00065 };
00066
00067 private:
00068
00069
00070 int findMatch(const Feature & ip1, const std::vector< Feature > & ipts);
00071
00072
00073
00074 double distSquare(VL::float_t *v1, VL::float_t *v2, int n);
00075
00076
00077 VL::PgmBuffer *__obj_img;
00078 std::vector< Feature > __obj_features;
00079 int __obj_num_features;
00080
00081
00082 VL::PgmBuffer *__image;
00083 std::vector< Feature > __img_features;
00084 int __img_num_features;
00085
00086
00087 int __samplingStep;
00088
00089 int __octaves;
00090
00091 int __levels;
00092
00093 VL::float_t __threshold;
00094 VL::float_t __edgeThreshold;
00095
00096 int __first;
00097
00098
00099
00100 float __sigman;
00101 float __sigma0;
00102
00103
00104 float __magnif;
00105
00106 int __noorient;
00107
00108 int __unnormalized;
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 int __vlen;
00120
00121
00122 fawkes::TimeTracker *__tt;
00123 unsigned int __loop_count;
00124 unsigned int __ttc_objconv;
00125 unsigned int __ttc_objfeat;
00126 unsigned int __ttc_imgconv;
00127 unsigned int __ttc_imgfeat;
00128 unsigned int __ttc_matchin;
00129 unsigned int __ttc_roimerg;
00130
00131
00132 };
00133
00134 #endif