SHOGUN  v3.0.0
 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/common.h>
18 
19 namespace shogun
20 {
28 {
29  public:
32 
41  CLBPPyrDotFeatures(CDenseFeatures<uint32_t>* image_set, int32_t image_w, int32_t image_h,
42  uint16_t num_pyramids);
43 
45  virtual ~CLBPPyrDotFeatures();
46 
54 
59  virtual int32_t get_dim_feature_space() const;
60 
66  virtual int32_t get_nnz_features_for_vector(int32_t num);
67 
72  virtual EFeatureType get_feature_type() const;
73 
78  virtual EFeatureClass get_feature_class() const;
79 
84  virtual int32_t get_num_vectors() const;
85 
93  virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2);
94 
104  virtual void* get_feature_iterator(int32_t vector_index);
105 
116  virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator);
117 
123  virtual void free_feature_iterator(void* iterator);
124 
129  CFeatures* duplicate() const;
130 
135  virtual const char* get_name() const { return "LBPPyrDotFeatures"; }
136 
144  virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len);
145 
154  virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
155  float64_t* vec2, int32_t vec2_len, bool abs_val=false);
156 
164  uint32_t* get_image(int32_t index, int32_t& width, int32_t& height);
165 
170  SGVector<char> get_transformed_image(int32_t index);
171  protected:
172 
176  uint32_t liblbp_pyr_get_dim(uint16_t nPyramids);
177 
184  uint8_t create_lbp_pattern(uint32_t* img, int32_t x, int32_t y);
185 
186  private:
187 
189  void init(CDenseFeatures<uint32_t>* image_set, int32_t image_w,
190  int32_t image_h);
191 
192  protected:
195 
197  int32_t image_width;
198 
200  int32_t image_height;
201 
203  int32_t vec_nDim;
204 };
205 }
206 #endif /* _LBP_PYR_DOTFEATURES__H__ */

SHOGUN Machine Learning Toolbox - Documentation