-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlauharriscornerdetectorglwidget.h
55 lines (45 loc) · 1.37 KB
/
lauharriscornerdetectorglwidget.h
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
#ifndef LAUHARRISCORNERDETECTORGLWIDGET_H
#define LAUHARRISCORNERDETECTORGLWIDGET_H
#include <QtCore>
#include <QObject>
#include "lauvideoglwidget.h"
/****************************************************************************/
/****************************************************************************/
/****************************************************************************/
class LAUHarrisCornerDetectorGLWidget : public LAUVideoGLWidget
{
Q_OBJECT
public:
explicit LAUHarrisCornerDetectorGLWidget(QWidget *parent = NULL) : LAUVideoGLWidget(parent)
{
qtScaleFactor = 0.05f;
qtCornerThreshold = 0.01f;
for (int n = 0; n < 5; n++) {
frameBufferObjects[n] = NULL;
}
}
~LAUHarrisCornerDetectorGLWidget();
QImage grabImage()
{
if (frameBufferObjects[4]) {
return (frameBufferObjects[4]->toImage());
}
return (QImage());
}
void setScaleFactor(float val)
{
qtScaleFactor = val;
}
void setCornerThreshold(float val)
{
qtCornerThreshold = val;
}
void initialize();
void process();
void paint();
private:
float qtScaleFactor, qtCornerThreshold;
QOpenGLFramebufferObject *frameBufferObjects[5];
QOpenGLShaderProgram programA, programB, programC, programD, programE;
};
#endif // LAUHARRISCORNERDETECTORGLWIDGET_H