forked from kokarem1/aioi3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
95 lines (66 loc) · 2.33 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QImage>
#include <vector>
#include <QList>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
bool eventFilter(QObject *object, QEvent *event);
int otsu(QImage &image, std::vector<int> &grays, int startX, int startY, int endX, int endY);
private slots:
void on_actionLoad_triggered();
void on_actionGrayscale_triggered();
void on_actionBinarization_manual_triggered();
void on_actionOtsu_global_triggered();
void on_actionSave_triggered();
void on_actionBrightness_gradient_triggered();
void on_actionOtsu_local_triggered();
void on_actionBrightness_quantization_triggered();
void on_checkBox_toggled(bool checked);
void on_actionBase_color_correction_triggered();
void on_actionGray_world_triggered();
void on_actionLinear_triggered();
void on_actionGamma_correction_triggered();
void on_actionBrightness_normalization_triggered();
void on_actionHistogram_equalization_triggered();
void on_actionLg_triggered();
void on_actionPiecewise_linear_triggered();
void on_actionZoom_triggered();
void on_actionBinary_partition_triggered();
void on_actionColor_histogram_triggered();
void on_actionShape_histogram_distance_triggered();
private:
Ui::MainWindow *ui;
QGraphicsScene *scene;
QGraphicsScene *scene_2;
QGraphicsScene *sceneHist;
QGraphicsScene *sceneHist_2;
QGraphicsPixmapItem *pixmapItem;
QGraphicsPixmapItem *pixmapItem_2;
QGraphicsPixmapItem *pixmapItem_3;
QGraphicsPixmapItem *pixmapItem_4;
std::vector<int> hist;
std::vector<int> hist_2;
int maxLevel;
int maxLevel_2;
QString pieceWiseLinearText;
std::vector< std::vector<double> > mA;
QList<QPixmap> picturesR;
int picturesRind;
double histDistance(std::vector<int> &hist1, std::vector<int> &hist2);
std::vector<int> colHist(QPixmap &pixmap);
void writeBits(int n, QBitArray &arr, int from, int to);
std::vector<double> hist2(QPixmap &pixmap, int size1, int size2);
double histDistance2(std::vector<double> &hist1, std::vector<double> &hist2);
};
#endif // MAINWINDOW_H