This repository has been archived by the owner on May 25, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
qimagescene.h
102 lines (79 loc) · 2.4 KB
/
qimagescene.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
#ifndef QIMAGESCENE_H
#define QIMAGESCENE_H
#include <QGraphicsScene>
#include <QList>
#include <QPainter>
#include <QPolygonF>
#include <QTime>
#include "prefix.h"
#include "imageconvector.h"
#include "qimage_painter.h"
//#include "sample_helper.h"
#include "sh_pp.h"
class QImageScene : public QGraphicsScene
{
Q_OBJECT
public:
QImageScene( QObject * parent = 0 );
public:
bool analyze();
void LoadImage(QString const& filename);
public:
pimages_info_row_type const& pimages_info_row() const { return m_pimages_info_row; }
pimages_info_row_type& pimages_info_row() { return m_pimages_info_row; }
protected:
void drawForeground(QPainter *painter, const QRectF &rect);
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);
private:
void update_image();
public:
QImage& showedImage() { EXTL_ASSERT(NULL != m_showedImage); return *m_showedImage; }
QImage const& showedImage() const { EXTL_ASSERT(NULL != m_showedImage); return *m_showedImage; }
image_type& handledImage() { return m_handledImage; }
image_type const& handledImage() const { return m_handledImage; }
void handledImage(image_type const& image) { m_handledImage = image; }
void showImgs(scoped_buffer<image_type> const& imgs);
private slots:
// make gray
void gy_general();
void gy_stretch();
void gy_histogram();
void gy_part_histogram();
// smooth
void oh_mean_smooth();
// threshold
void th_global_basic_threshold();
void th_global_otsu_threshold();
void th_partial_basic_threshold();
void th_partial_otsu_threshold();
// denoising
void dn_median_denoising();
void dn_discrete_denoising();
// split
void cs_kmean_split();
void cs_fcm_split();
void cs_labeling_split();
// edge detect
void sobel();
void prewitt();
void kirsch();
void isotropic();
void marr();
// deskew
void deskew();
// thinning
void thinning();
// pre-process
void pp_preprocess();
private:
QImage* m_showedImage;
image_type m_handledImage;
pimages_info_row_type m_pimages_info_row;
bool m_is_pressed;
QPolygonF m_ploygon;
QTime m_release_time;
bool m_is_online;
};
#endif // QIMAGESCENE_H