PyramidChi2.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef PYRAMIDCHI2_H_
00012 #define PYRAMIDCHI2_H_
00013
00014 #include "lib/common.h"
00015 #include "kernel/SimpleKernel.h"
00016 #include "features/Features.h"
00017 #include "features/RealFeatures.h"
00018
00019
00020
00022 class CPyramidChi2 : public CSimpleKernel<float64_t>
00023 {
00024 public:
00025
00036 CPyramidChi2(
00037 int32_t size, float64_t width2,
00038 int32_t* pyramidlevels2, int32_t numlevels2,
00039 int32_t numbinsinhistogram2, float64_t* weights2, int32_t numweights2);
00040
00053 CPyramidChi2(
00054 CRealFeatures* l, CRealFeatures* r, int32_t size, float64_t width2,
00055 int32_t* pyramidlevels2, int32_t numlevels2,
00056 int32_t numbinsinhistogram2, float64_t* weights2, int32_t numweights2);
00057
00063 virtual bool init(CFeatures* l, CFeatures* r);
00064
00065
00066 virtual ~CPyramidChi2();
00067
00069 virtual void cleanup();
00070
00071
00072
00073
00074
00075
00076 virtual bool load_init(FILE* src);
00077
00083 virtual bool save_init(FILE* dest);
00084
00086 virtual EKernelType get_kernel_type()
00087 {
00088
00089 return K_PYRAMIDCHI2;
00090 }
00091
00093 virtual const char* get_name() { return "PyramidoverChi2"; }
00094
00096 void setstandardweights();
00097
00099 bool sanitycheck_weak();
00100
00101 protected:
00108 virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00109
00110 protected:
00112 float64_t width;
00114 int32_t* pyramidlevels;
00115
00117 int32_t numlevels;
00119 int32_t numbinsinhistogram;
00121 float64_t* weights;
00122
00124 int32_t numweights;
00125
00126 };
00127
00128 #endif