SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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__ */
SGVector< char > get_transformed_image(int32_t index)
virtual EFeatureClass get_feature_class() const
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
uint8_t create_lbp_pattern(uint32_t *img, int32_t x, int32_t y)
virtual int32_t get_num_vectors() const
virtual void free_feature_iterator(void *iterator)
Features that support dot products among other operations.
Definition: DotFeatures.h:44
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual EFeatureType get_feature_type() const
virtual int32_t get_dim_feature_space() const
virtual const char * get_name() const
double float64_t
Definition: common.h:50
CFeatures * duplicate() const
uint32_t * get_image(int32_t index, int32_t &width, int32_t &height)
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
virtual void * get_feature_iterator(int32_t vector_index)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
CDenseFeatures< uint32_t > * images
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
uint32_t liblbp_pyr_get_dim(uint16_t nPyramids)
Implements Local Binary Patterns with Scale Pyramids as dot features for a set of images...
virtual int32_t get_nnz_features_for_vector(int32_t num)

SHOGUN Machine Learning Toolbox - Documentation