-
Notifications
You must be signed in to change notification settings - Fork 1
/
sdfilterdialog.h
136 lines (120 loc) · 2.82 KB
/
sdfilterdialog.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef SDFILTERDIALOG_H
#define SDFILTERDIALOG_H
#include <QObject>
#include <QDialog>
#include <QLabel>
#include <QSlider>
#include <QBoxLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QGroupBox>
#include <QLineEdit>
#include <QPushButton>
#include <QImage>
#include <QComboBox>
#include "imageprocess.h"
#include "padding.h"
#include "floatslider.h"
#include <QApplication>
#include <QDesktopWidget>
enum FilterType {
Sobel,
Roberts,
Prewitt,
Laplacian4,
Laplacian8,
LOG,
};
QT_BEGIN_NAMESPACE
class QAction;
class QLabel;
class QMenu;
class QMdiArea;
class QMdiSubWindow;
class QSlider;
class QLineEdit;
class QPushButton;
class QGroupBox;
class QBoxLayout;
class QHBoxLayout;
class QVBoxLayout;
class QComboBox;
class QApplication;
class QDesktopWidget;
QT_END_NAMESPACE
class SDFilterDialog : public QDialog
{
Q_OBJECT
public:
SDFilterDialog(QImage inputImage);
~SDFilterDialog()
{
if (rgb)
delete [] rgb;
if (rgbPadded)
delete [] rgbPadded;
if (rgbFilteredX)
delete [] rgbFilteredX;
if (filterKernelX)
delete [] filterKernelX;
}
QImage getImage() {return dstImage;}
//void showEvent(QShowEvent *event);
private:
void iniUI();
QImage imageFilter(int inputFilterType);
QImage imageLOGFilter(float sigma);
QImage srcImage;
QImage robertsImage;
QImage prewittImage;
QImage sobelImage;
QImage laplacian4Image;
QImage laplacian8Image;
QImage LOGImage;
QImage paddedImage;
QImage filteredSpectrumImage;
QImage dstImage;
uchar *rgb = nullptr;
uchar *rgbPadded = nullptr;
uchar *rgbFilteredX = nullptr;
uchar *rgbFilteredY = nullptr;
float *filterKernelX = nullptr;
float *filterKernelY = nullptr;
QLabel *srcLabel;
QLabel *robertsLabel;
QLabel *prewittLabel;
QLabel *sobelLabel;
QLabel *laplacian4Label;
QLabel *laplacian8Label;
QLabel *LOGLabel;
QLabel *srcImageLabel;
QLabel *robertsImageLabel;
QLabel *prewittImageLabel;
QLabel *sobelImageLabel;
QLabel *laplacian4ImageLabel;
QLabel *laplacian8ImageLabel;
QLabel *LOGImageLabel;
QLabel *paddedImageLabel;
QLabel *filteredSpectrumImageLabel;
QLabel *dstImageLabel;
int halfKernelSize = 3;
float sigma;
float maxSigma;
FloatSlider *sigmaSlider;
QLineEdit *sigmaEdit;
QLabel *sigmaLabel;
int borderType = 0;
QLabel *borderTypeLabel;
QComboBox *borderTypeComboBox;
int filterType = 0;
QLabel *filterTypeLabel;
QComboBox *filterTypeComboBox;
QPushButton *btnOK;
QPushButton *btnCancel;
QPushButton *btnClose;
private slots:
void setImage(QImage image, QLabel *label);
void updateLOGImage(float value);
};
#endif // TDFILTERDIALOG_H