-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdrawlabel.h
49 lines (37 loc) · 1023 Bytes
/
drawlabel.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
#ifndef DRAWLABEL_H
#define DRAWLABEL_H
#include <QLabel>
#include <QPoint>
#include <QVector>
#include "mainwindow.h"
#include <iostream>
#include <vector>
#include <cv.h>
#define DEF_POINT_RADIUS 5
#define DEF_POINT_RADIUS_RM 10
class DrawLabel : public QLabel
{
Q_OBJECT
public:
explicit DrawLabel(QWidget *parent = 0);
void mousePressEvent(QMouseEvent *ev);
void wheelEvent(QWheelEvent *ev);
void paintEvent(QPaintEvent *ev);
void resizeEvent(QResizeEvent *ev);
std::vector<cv::Point> listPointsOCV;
std::vector<int> listLabelsOCV;
std::vector<cv::Point> listExtPoints;
void setMainWindowPtr(MainWindow *mw);
void setPixmap(const QPixmap &pxm);
void refreshValidClasses();
signals:
public slots:
void clearPoints();
private:
void drawPoints(QPainter &p);
void tryToRemovePoints(int x, int y);
void appendClusterOnPosition(int x, int y);
MainWindow* mw;
QPixmap pxm;
};
#endif // DRAWLABEL_H