PyramidChi2.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2008-2009 Alexander Binder
00008  * Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society
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/SimpleFeatures.h"
00018 
00019 
00025 class CPyramidChi2 : public CSimpleKernel<float64_t>
00026 {
00027 public:
00028 
00039     CPyramidChi2(
00040         int32_t size, float64_t width2,
00041         int32_t* pyramidlevels2, int32_t numlevels2,
00042         int32_t  numbinsinhistogram2, float64_t* weights2, int32_t numweights2);
00043 
00056     CPyramidChi2(
00057         CSimpleFeatures<float64_t>* l, CSimpleFeatures<float64_t>* r, int32_t size, float64_t width2,
00058         int32_t* pyramidlevels2, int32_t numlevels2,
00059         int32_t  numbinsinhistogram2, float64_t* weights2, int32_t numweights2);
00060 
00066     virtual bool init(CFeatures* l, CFeatures* r);
00067 
00068 
00069     virtual ~CPyramidChi2();
00070 
00072     virtual void cleanup();
00073 
00074     /* load kernel init_data
00075      *
00076      * @param src source file to load from
00077      * @return if loading was successful
00078      */
00079     virtual bool load_init(FILE* src);
00080 
00086     virtual bool save_init(FILE* dest);
00087 
00089     virtual EKernelType get_kernel_type()
00090     {
00091         //preliminary output
00092         return K_PYRAMIDCHI2;
00093     }
00094 
00096     virtual const char* get_name() const { return "PyramidoverChi2"; }
00097 
00099     void setstandardweights();
00100 
00102     bool sanitycheck_weak();
00103 
00104 protected:
00111     virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00112 
00113 protected:
00115     float64_t width;
00117     int32_t* pyramidlevels;
00118 
00120     int32_t numlevels;
00122     int32_t numbinsinhistogram;
00124     float64_t* weights;
00125 
00127     int32_t numweights;
00128     //bool sanitycheckbit;
00129 };
00130 
00131 #endif /*PYRAMIDCHI2_H_*/

SHOGUN Machine Learning Toolbox - Documentation