00001
00002 #ifndef IMDESC_FEATURE_HPP
00003 #define IMDESC_FEATURE_HPP
00004
00005 #include <vector>
00006 #include "image/JfrImage.hpp"
00007 #include "image/zncc.hpp"
00008 #include "imdesc/imdescException.hpp"
00009
00010 namespace jafar {
00011 namespace imdesc {
00012
00017 class KBFeature : public jafar::image::Pixel {
00018 public:
00020 double yd;
00021
00023 int sc;
00024
00026 double hd;
00027
00029 double wd;
00030
00031
00033 KBFeature(int x_=0, int y_=0, int sc_=0,
00034 double hd_=0, double wd_=0, double yd_=0)
00035 : jafar::image::Pixel(x_,y_),
00036 yd(yd_),
00037 sc(sc_),
00038 hd(hd_),
00039 wd(wd_){
00040 };
00041
00042 ~KBFeature() {
00043 };
00044
00046 bool operator<(const KBFeature& f_) const {
00047 return (yd < f_.yd);
00048 }
00049
00051 bool operator>(const KBFeature& f_) const {
00052 return (yd > f_.yd);
00053 }
00054
00056 KBFeature& operator=(const KBFeature& f_) {
00057 x = f_.x;
00058 y = f_.y;
00059 yd = f_.yd;
00060 sc = f_.sc;
00061 hd = f_.hd;
00062 wd = f_.wd;
00063 return *this;
00064 };
00065
00066
00070 inline const void getPatch(const jafar::image::JfrImage& src_,
00071 jafar::image::JfrImage& patch_) const {
00072 jafar::image::JfrImage* sub = src_.getSubImage((x-sc),(y-sc),(2*sc+1),(2*sc+1));
00073 sub->resize(patch_);
00074 delete sub;
00075 };
00076
00077 };
00078
00079
00080
00081 }
00082 }
00083
00084 #endif // IMDESC_FEATURE_HPP