SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LBPPyrDotFeatures.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2010 Vojtech Franc, Soeren Sonnenburg
8  * Written (W) 2013 Evangelos Anagnostopoulos
9  * Copyright (C) 2010 Vojtech Franc, xfrancv@cmp.felk.cvut.cz
10  * Copyright (C) 2010 Berlin Institute of Technology
11  */
12 #ifndef _LBP_PYR_DOTFEATURES__H__
13 #define _LBP_PYR_DOTFEATURES__H__
14 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/lib/common.h>
20 
21 namespace shogun
22 {
30 {
31  public:
34 
43  CLBPPyrDotFeatures(CDenseFeatures<uint32_t>* image_set, int32_t image_w, int32_t image_h,
44  uint16_t num_pyramids);
45 
47  virtual ~CLBPPyrDotFeatures();
48 
56 
61  virtual int32_t get_dim_feature_space() const;
62 
68  virtual int32_t get_nnz_features_for_vector(int32_t num);
69 
74  virtual EFeatureType get_feature_type() const;
75 
80  virtual EFeatureClass get_feature_class() const;
81 
86  virtual int32_t get_num_vectors() const;
87 
95  virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2);
96 
106  virtual void* get_feature_iterator(int32_t vector_index);
107 
118  virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator);
119 
125  virtual void free_feature_iterator(void* iterator);
126 
131  CFeatures* duplicate() const;
132 
137  virtual const char* get_name() const { return "LBPPyrDotFeatures"; }
138 
146  virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len);
147 
156  virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
157  float64_t* vec2, int32_t vec2_len, bool abs_val=false);
158 
166  uint32_t* get_image(int32_t index, int32_t& width, int32_t& height);
167 
172  SGVector<char> get_transformed_image(int32_t index);
173  protected:
174 
178  uint32_t liblbp_pyr_get_dim(uint16_t nPyramids);
179 
186  uint8_t create_lbp_pattern(uint32_t* img, int32_t x, int32_t y);
187 
188  private:
189 
191  void init(CDenseFeatures<uint32_t>* image_set, int32_t image_w,
192  int32_t image_h);
193 
194  protected:
197 
199  int32_t image_width;
200 
202  int32_t image_height;
203 
205  int32_t vec_nDim;
206 };
207 }
208 #endif /* _LBP_PYR_DOTFEATURES__H__ */

SHOGUN Machine Learning Toolbox - Documentation