-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathimagesetprocessor.h
More file actions
86 lines (63 loc) · 1.84 KB
/
imagesetprocessor.h
File metadata and controls
86 lines (63 loc) · 1.84 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
#ifndef IMAGESETPROCESSOR_H
#define IMAGESETPROCESSOR_H
#include <QDialog>
#include <QFileDialog>
#include <QProcess>
#include <QMessageBox>
#include <QThread>
#include <atomic>
namespace Ui {
class ImageSetProcessor;
}
class ProcessThread;
class ImageSetProcessor : public QDialog
{
Q_OBJECT
public:
static void listFiles(QDir directory, QString indent, QList<QString> &files);
explicit ImageSetProcessor(const QString &cnnPath, QWidget *parent = 0);
~ImageSetProcessor();
private slots:
void on_browseImageSetFolder_clicked();
void on_browseProcessedSaveFolder_clicked();
void on_buttonBox_accepted();
void on_browseProcessedFolder_clicked();
void on_pushButton_clicked();
void on_processButton_clicked();
void closeEvent(QCloseEvent *event);
void on_aioCheckbox_toggled(bool checked);
private:
Ui::ImageSetProcessor *ui;
std::atomic<int> imagesCompleted;
std::atomic<bool> isProcessing;
QString cnnPath;
ProcessThread *worker;
};
/*
* Quick class definition for the processing thread
*/
class ProcessThread : public QThread
{
Q_OBJECT
public:
ProcessThread(const QString &imageFolder, const QString &gpsLogFolder,
const QString &outputFolder, const QString &cnnPath, bool aio,
bool removeFalsePositives)
: imageFolder(imageFolder), gpsLogFolder(gpsLogFolder), numImages(0),
outputFolder(outputFolder), cnnPath(cnnPath), process(true), aio(aio),
removeFalsePositives(removeFalsePositives)
{}
std::atomic<bool> process;
std::atomic<int> numImages;
signals:
void imageDone();
protected:
void run();
QString imageFolder;
QString gpsLogFolder;
QString outputFolder;
QString cnnPath;
std::atomic<bool> aio;
std::atomic<bool> removeFalsePositives;
};
#endif // IMAGESETPROCESSOR_H