-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewform.cpp
More file actions
63 lines (48 loc) · 1.11 KB
/
viewform.cpp
File metadata and controls
63 lines (48 loc) · 1.11 KB
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
#include "viewform.h"
#include "ui_viewform.h"
#include "histogram1d.h"
#include "qtform.h"
#include "histogram1d.h"
#include "colorhistogram.h"
ViewForm::ViewForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::ViewForm)
{
ui->setupUi(this);
imageLabel = new ImageLabel(this);
initilize();
}
ViewForm::~ViewForm()
{
delete ui;
}
void ViewForm::showEvent(QShowEvent * event)
{
return;
}
void ViewForm::initilize()
{
mouseDownPoint = QPoint(0, 0);
mouseMovePoint = QPoint(0, 0);
mouseUpPoint = QPoint(0, 0);
imageLabel->imageRead("ee.jpg");
ui->gridLayoutImage->addWidget(imageLabel, 0, 0, 1, 1);
imshow("origin", imageLabel->getImage());
}
void ViewForm::paintEvent(QPaintEvent *event)
{
}
void ViewForm::imageRead(string filename)
{
image = imread(filename, 0);
int roiWidth, roiHeight;
roiHeight = roiWidth = 100;
imageROI = image(Rect(image.rows/2,
image.cols/2,
roiHeight,
roiWidth));
}
bool ViewForm::eventFilter(QObject *watched, QEvent *event)
{
return true;
}