00001
00002
00003 #ifndef IMDESC_SSDETECTOR_HPP
00004 #define IMDESC_SSDETECTOR_HPP
00005
00006 #include <vector>
00007 #include <list>
00008 #include <string>
00009 #include "kernel/keyValueFile.hpp"
00010 #include "image/JfrImage.hpp"
00011 #include "imdesc/feature.hpp"
00012
00013 namespace jafar {
00014 namespace imdesc {
00015
00022 class SSDetector : public jafar::kernel::KeyValueFileSaveLoad {
00023 public :
00026 SSDetector() : byDefault(true) {};
00027
00031 SSDetector(const std::string& file_);
00032
00042 SSDetector(int startScale_,
00043 int stopScale_,
00044 int nbins_,
00045 double yt_,
00046 double wt_,
00047 bool fplogpFlag_,
00048 int fplogpprec_ = 10000);
00049
00051 ~SSDetector() {
00052 };
00053
00054
00059 void compute(const jafar::image::JfrImage& src_,
00060 std::vector< jafar::imdesc::KBFeature >& fVec_);
00061
00065 void computeAndDraw(jafar::image::JfrImage& src_);
00066
00067 protected:
00071 void loadKeyValueFile(jafar::kernel::KeyValueFile const& keyValueFile);
00072
00076 void saveKeyValueFile(jafar::kernel::KeyValueFile& keyValueFile);
00077
00078 private:
00080 bool byDefault;
00082 int startScale;
00084 int stopScale;
00086 int nbins;
00088 double yt;
00090 double wt;
00092 bool fplogpFlag;
00094 int fplogpprec;
00095
00097 std::vector<double> fplogp;
00098
00101 void do_CalcSalScale1D(const jafar::image::JfrImage &Image_,
00102 std::vector<jafar::imdesc::KBFeature> &fVec_);
00103
00106 void do_CalcSalScale2D(const jafar::image::JfrImage &Image_,
00107 std::vector<jafar::imdesc::KBFeature> &fVec_);
00108
00111 void do_CalcSalScale3D(const jafar::image::JfrImage &Image_,
00112 std::vector<jafar::imdesc::KBFeature> &fVec_);
00113
00116 void clusterize(const jafar::image::JfrImage &Image_,
00117 std::vector<jafar::imdesc::KBFeature>& features_,
00118 std::vector<jafar::imdesc::KBFeature>& clust_) const;
00119
00120
00121 };
00122
00123 }
00124 }
00125
00126 #endif // IMDESC_SSDETECTOR_HPP