FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
Loading...
Searching...
No Matches
replay.h
1/*
2This file is part of Fast Track.
3
4 FastTrack is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 FastTrack is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with FastTrack. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef REPLAY_H
19#define REPLAY_H
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <time.h>
24#include <QAction>
25#include <QCheckBox>
26#include <QComboBox>
27#include <QDebug>
28#include <QDir>
29#include <QDirIterator>
30#include <QFile>
31#include <QFileDialog>
32#include <QFileInfo>
33#include <QHash>
34#include <QImage>
35#include <QLCDNumber>
36#include <QLabel>
37#include <QLayout>
38#include <QLineEdit>
39#include <QMainWindow>
40#include <QMessageBox>
41#include <QMouseEvent>
42#include <QProgressBar>
43#include <QPushButton>
44#include <QScrollArea>
45#include <QScrollBar>
46#include <QSettings>
47#include <QSlider>
48#include <QSpinBox>
49#include <QString>
50#include <QTableWidgetItem>
51#include <QThread>
52#include <QTimer>
53#include <QUndoStack>
54#include <QWidget>
55#include <fstream>
56#include <opencv2/core/ocl.hpp>
57#include <string>
58#include <vector>
59#include "annotation.h"
60#include "data.h"
61#include "opencv2/highgui/highgui.hpp"
62#include "opencv2/imgproc/imgproc.hpp"
63#include "timeline.h"
64#include "videoreader.h"
65using namespace std;
66using namespace cv;
67
68namespace Ui {
69class Replay;
70}
71
72class Replay : public QMainWindow {
73 Q_OBJECT
74
75 public:
76 explicit Replay(QWidget *parent = nullptr, bool standalone = true, Timeline *slider = nullptr, VideoReader *videoReader = nullptr);
77 Replay(const Replay &T) = delete;
78 Replay &operator=(const Replay &T) = delete;
79 Replay &operator=(Replay &&T) = delete;
80 Replay(Replay &&T) = delete;
81 ~Replay();
82 Data *trackingData;
83 Annotation *annotation;
84
85 private:
86 Ui::Replay *ui;
87 QShortcut *deletedFrameFocus;
88 bool isStandalone;
89 QSettings *settingsFile;
90
91 QUndoStack *commandStack;
92 QAction *undoAction;
93 QAction *redoAction;
94
95 QComboBox *object1Replay;
96 QComboBox *object2Replay;
97 QSpinBox *deletedFrameNumber;
98
99 QString memoryDir;
100
101 vector<Point3i> colorMap;
102 QList<int> occlusionEvents;
108 bool object;
112 QList<int> ids;
113 VideoReader *video;
114
115 public slots:
116
117 void openReplay();
118 void openTrackingDir();
119 void loadReplay(const QString &dir);
120 void loadTrackingDir(const QString &dir);
121 void loadFrame(int frameIndex);
122 bool eventFilter(QObject *target, QEvent *event) override;
123 void updateInformation(int objectId, int imageIndex, QTableWidget *table);
124 void correctTracking();
125 void nextOcclusionEvent();
127 void saveTrackedMovie();
128 void sliderConnection(const int index);
129 void clear();
130
131 signals:
132 void opened(bool);
133};
134
135#endif // REPLAY_H
This class allows to load tracking annotation file.
Definition annotation.h:15
This class allows to load tracking data produced by the Tracking class.
Definition data.h:24
void loadTrackingDir(const QString &dir)
Loads a tracking analysis folder from a video file.
Definition replay.cpp:434
bool eventFilter(QObject *target, QEvent *event) override
Manages all the mouse input in the display.
Definition replay.cpp:566
void loadFrame(int frameIndex)
Displays the image and the tracking data in the ui->displayReplay. Triggered when the ui->replaySlide...
Definition replay.cpp:469
QSize originalImageSize
Definition replay.h:110
bool isReplayable
Definition replay.h:105
vector< Point3i > colorMap
Definition replay.h:101
QString memoryDir
Definition replay.h:99
void correctTracking()
Gets the index of the two selected objects, the start index, swaps the data from the start index to t...
Definition replay.cpp:633
bool object
Definition replay.h:108
QList< int > occlusionEvents
Definition replay.h:102
QShortcut * deletedFrameFocus
Definition replay.h:87
QSize resizedFrame
Definition replay.h:109
void updateInformation(int objectId, int imageIndex, QTableWidget *table)
Update the information of an object inside a table widget.
Definition replay.cpp:621
void saveTrackedMovie()
Saves the tracked movie in .avi. Triggered when ui->previousReplay is pressed.
Definition replay.cpp:670
void openReplay()
Opens a dialogue to select a folder.
Definition replay.cpp:334
void clear()
Clears replay data.
Definition replay.cpp:354
void nextOcclusionEvent()
Finds and displays the next occlusion event on the ui->replayDisplay. Triggered when ui->nextReplay i...
Definition replay.cpp:648
void loadReplay(const QString &dir)
Loads a video/images sequence and the last analysis performed.
Definition replay.cpp:374
void previousOcclusionEvent()
Finds and displays the previous occlusion event on the ui->replayDisplay. Triggered when ui->previous...
Definition replay.cpp:659
int currentIndex
Definition replay.h:111
int autoPlayerIndex
Definition replay.h:107
int maxIndex
Definition replay.h:104
int replayNumberObject
Definition replay.h:103
void openTrackingDir()
Opens a dialogue to select a Tracking_Result dir, necessitate a video already opened and matching tra...
Definition replay.cpp:344
int replayFps
Definition replay.h:106
Draw a time line with cursor, hover and marker set.
Definition timeline.h:26
This class is intended to abstract the opening of a video, it can load image sequence and video with ...
Definition videoreader.h:36