-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabelinfo.cpp
More file actions
93 lines (59 loc) · 1.44 KB
/
Copy pathlabelinfo.cpp
File metadata and controls
93 lines (59 loc) · 1.44 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
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
#include "labelinfo.h"
#include "ui_labelinfo.h"
#include "myheader.h"
#include "customizelabels.h"
#include "labelprocessingblocks.h"
bool cflag = false;
char *tempname;
LabelInfo::LabelInfo(QWidget *parent) :
QDialog(parent),
ui(new Ui::LabelInfo)
{
ui->setupUi(this);
for(int i=0;i<Labels.size();i++)
ui->comboBox->addItem(Labels[i]);
}
LabelInfo::~LabelInfo()
{
delete ui;
}
int *(*LabelColor);
int *LabelCount;
vector<Mat> LabelImages;
Mat LabelImageInOne;
RNG rng(12345);
void LabelInfo::on_pushButton_clicked() // OK
{
LabelCount = (int *)malloc(Labels.size()*sizeof(int));
LabelColor = (int **)malloc(Labels.size()*sizeof(int *));
for(int i=0;i<Labels.size();i++)
{
LabelColor[i] = (int *)malloc(3 * sizeof(int));
LabelCount[i] = 0;
}
for(int i=0;i<Labels.size();i++)
{
for(int j=0;j<3;j++)
{
LabelColor[i][j] = rng.uniform(0, 255);
}
}
for(int i=0;i<Labels.size();i++)
{
Mat temp = Mat(src.rows,src.cols,CV_8UC1,Scalar(255));
LabelImages.push_back(temp);
temp.release();
}
LabelImageInOne = Mat(src.rows,src.cols,CV_8UC1,Scalar(255));
this->close();
LabelProcessingBlocks LPB;
LPB.setModal(true);
LPB.exec();
}
void LabelInfo::on_pushButton_2_clicked() // Customized Label
{
this->close();
CustomizeLabels CL;
CL.setModal(true);
CL.exec();
}