-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimgproc.h
48 lines (39 loc) · 1.29 KB
/
imgproc.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
#include <QImage>
class imgProc
{
public:
QImage source;
QImage result;
imgProc() {}
void setSource(QImage load) {
result = source = load;
}
//Алгоритмы перевода в оттенки серого
void toGray(int method);
//Алгоритмы бинаризации
void ThBinarize(int threshold, bool isAllChannels);
void OtsuBinarize(bool isAllChannels);
//Алгоритмы удаления шума
void MedianBlur(int size);
void GaussianBlur(int size);
void BoxBlur(int size);
//Алгоритмы выделения границ
void SobelEdges();
void RobertsEdges();
void PrewittEdges();
//Алгоритмы морфологической фильтрации
void Dilate(QImage buf, int size);
void Erode(QImage& buf, int size);
void Opening(QImage& buf, int size);
void Closing(QImage& buf, int size);
void TopHat(QImage& buf, int size);
void BlackHat(QImage& buf, int size);
void MorphEdges(QImage& buf, int size);
//Фильтры общего вида
void SharpenFilter();
void EmbossFilter();
void Invert();
private:
int GetThr(QVector<int>& hist);
void ApplyKernel(QImage& src, QImage& res,QVector<QVector<double>>& kernel, double bias = 0);
};