-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyramidGL.h
More file actions
119 lines (110 loc) · 3.75 KB
/
PyramidGL.h
File metadata and controls
119 lines (110 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
////////////////////////////////////////////////////////////////////////////
// File: PyramidGL.h
// Author: Changchang Wu
// Description : interface for the PyramdGL
// class PyramidNaive and PyramidPacked are derived from PyramidGL
//
// Copyright (c) 2007 University of North Carolina at Chapel Hill
// All Rights Reserved
//
// Permission to use, copy, modify and distribute this software and its
// documentation for educational, research and non-profit purposes, without
// fee, and without a written agreement is hereby granted, provided that the
// above copyright notice and the following paragraph appear in all copies.
//
// The University of North Carolina at Chapel Hill make no representations
// about the suitability of this software for any purpose. It is provided
// 'as is' without express or implied warranty.
//
// Please send BUG REPORTS to ccwu@cs.unc.edu
//
////////////////////////////////////////////////////////////////////////////
#ifndef _PYRAMID_GL_H
#define _PYRAMID_GL_H
class GLTexImage;
class SiftParam;
class ProgramGPU;
class ShaderMan;
class GlobalUtil;
class SiftPyramid;
class PyramidGL:public SiftPyramid
{
protected:
GLTexImage* _histoPyramidTex;
GLTexImage* _featureTex;
GLTexImage* _descriptorTex;
GLTexImage* _orientationTex;
public:
void InitializeContext();
void SetLevelFeatureNum(int idx, int num);
void GetTextureStorageSize(int num, int &fw, int& fh);
void GetAlignedStorageSize(int num, int align, int &fw, int &fh);
static void InterlaceDescriptorF2(int w, int h, float* buf, float* pd, int step);
static void NormalizeDescriptor(int num, float*pd);
virtual void DownloadKeypoints();
virtual int ResizeFeatureStorage();
////////////////////////////
virtual void DestroyPerLevelData();
virtual void DestroySharedData();
virtual void GetFeatureDescriptors();
virtual void GenerateFeatureListTex();
virtual void ReshapeFeatureListCPU();
virtual void GenerateFeatureDisplayVBO();
virtual void CleanUpAfterSIFT();
virtual GLTexImage* GetBaseLevel(int octave, int dataName = DATA_GAUSSIAN)=0;
public:
PyramidGL(SiftParam&sp);
virtual ~PyramidGL();
};
class PyramidNaive:public PyramidGL, public ShaderMan
{
protected:
GLTexImage * _texPyramid;
GLTexImage * _auxPyramid;
public:
void DestroyPyramidData();
void GetSimplifiedOrientation();
void GenerateFeatureListCPU();
virtual void GetFeatureOrientations();
virtual void GenerateFeatureList();
void DetectKeypointsEX();
void ComputeGradient();
GLTexImage* GetLevelTexture(int octave, int level);
GLTexImage* GetBaseLevel(int octave, int dataName = DATA_GAUSSIAN);
GLTexImage* GetLevelTexture(int octave, int level, int dataName);
void BuildPyramid(GLTexInput * input);
void InitPyramid(int w, int h, int ds);
void FitPyramid(int w, int h);
void ResizePyramid(int w, int h);
void FitHistogramPyramid();
PyramidNaive(SiftParam & sp);
~PyramidNaive();
private:
void GenerateFeatureList(int i, int j);
};
class PyramidPacked:public PyramidGL, public ShaderMan
{
GLTexPacked * _allPyramid;
public:
PyramidPacked(SiftParam& sp);
~PyramidPacked();
void DestroyPyramidData();
void DetectKeypointsEX();
void ComputeGradient();
void BuildPyramid(GLTexInput * input);
void InitPyramid(int w, int h, int ds);
void FitPyramid(int w, int h);
void ResizePyramid(int w, int h);
void FitHistogramPyramid();
void GenerateFeatureListCPU();
void GenerateFeatureList();
void GetSimplifiedOrientation();
void GetFeatureOrientations();
GLTexImage* GetBaseLevel(int octave, int dataName = DATA_GAUSSIAN);
GLTexImage* GetLevelTexture(int octave, int level);
GLTexImage* GetLevelTexture(int octave, int level, int dataName);
virtual int IsUsingRectDescription(){return _existing_keypoints & SIFT_RECT_DESCRIPTION; }
private:
void GenerateFeatureList(int i, int j);
};
#endif