Go to the documentation of this file.00001 #ifndef __fovis_gray_descriptor_hpp__
00002 #define __fovis_gray_descriptor_hpp__
00003
00004 #include <inttypes.h>
00005 #include <stdlib.h>
00006
00007 namespace fovis
00008 {
00009
00010 class KeypointData;
00011
00017 class IntensityDescriptorExtractor {
00018 public:
00024 IntensityDescriptorExtractor(int raw_gray_stride, int feature_window_size)
00025 : _raw_gray_stride(raw_gray_stride),
00026 _feature_window_size(feature_window_size) {
00027 initialize();
00028 }
00029
00030 virtual ~IntensityDescriptorExtractor () {
00031 delete[] _descriptor_index_offsets;
00032 free(_descriptor_brightness_offset);
00033 }
00034
00042 void populateDescriptorInterp(uint8_t *image,
00043 float x, float y,
00044 uint8_t* descriptor) const;
00045
00050 void populateDescriptorAligned(uint8_t *image,
00051 int x, int y,
00052 uint8_t* descriptor) const;
00053
00063 void populateDescriptorsInterp(uint8_t* image,
00064 const KeypointData* keypoints,
00065 int num_keypoints,
00066 uint8_t* descriptors) const;
00067
00077 void populateDescriptorsAligned(uint8_t* image,
00078 const KeypointData* keypoints,
00079 int num_keypoints,
00080 uint8_t* descriptors) const;
00081
00087 int getDescriptorStride() const {
00088 return _descriptor_stride;
00089 }
00090
00095 const int* getDescriptorIndexOffsets() const {
00096 return _descriptor_index_offsets;
00097 }
00098
00102 int getDescriptorLength() const {
00103 return _descriptor_len;
00104 }
00105
00106 private:
00107 IntensityDescriptorExtractor(const IntensityDescriptorExtractor& other);
00108 IntensityDescriptorExtractor& operator=(const IntensityDescriptorExtractor& other);
00109
00110 void initialize();
00111 void normalizeDescriptor(uint8_t* desc) const;
00112
00113 int _raw_gray_stride;
00114
00115 int _num_descriptor_pad_bytes;
00116 uint8_t* _descriptor_brightness_offset;
00117 int _brightess_offset_num_sse_ops;
00118
00119 int _descriptor_len;
00120 int _feature_window_size;
00121 int _descriptor_stride;
00122 int* _descriptor_index_offsets;
00123
00124 };
00125
00126 }
00127 #endif