FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
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 <QMap>
41#include <QMessageBox>
42#include <QMouseEvent>
43#include <QProgressBar>
44#include <QPushButton>
45#include <QScrollArea>
46#include <QScrollBar>
47#include <QSettings>
48#include <QSlider>
49#include <QSpinBox>
50#include <QString>
51#include <QTableWidgetItem>
52#include <QThread>
53#include <QTimer>
54#include <QUndoStack>
55#include <QWidget>
56#include <fstream>
57#include <opencv2/core/ocl.hpp>
58#include <string>
59#include <vector>
60#include "annotation.h"
61#include "data.h"
62#include "opencv2/highgui/highgui.hpp"
63#include "opencv2/imgproc/imgproc.hpp"
64#include "timeline.h"
65#include "videoreader.h"
66using namespace std;
67using namespace cv;
68
69namespace Ui {
70class Replay;
71}
72
73class Replay : public QMainWindow {
74 Q_OBJECT
75
76 public:
77 explicit Replay(QWidget *parent = nullptr, bool standalone = true, Timeline *slider = nullptr, VideoReader *videoReader = nullptr);
78 ~Replay();
79 Data *trackingData;
80 Annotation *annotation;
81
82 private:
83 Ui::Replay *ui;
84 QShortcut *deletedFrameFocus;
85 bool isStandalone;
86
87 QUndoStack *commandStack;
88 QAction *undoAction;
89 QAction *redoAction;
90
91 QComboBox *object1Replay;
92 QComboBox *object2Replay;
93 QSpinBox *deletedFrameNumber;
94
95 QString memoryDir;
97 vector<Point3i> colorMap;
98 QList<int> occlusionEvents;
104 bool object;
108 double currentZoom;
109 QPointF panReferenceClick;
110 QPointF zoomReferencePosition;
111 QList<int> ids;
112 VideoReader *video;
113
114 public slots:
115
116 void openReplay();
117 void openTrackingDir();
118 void loadReplay(const QString &dir);
119 void loadTrackingDir(const QString &dir);
120 void loadFrame(int frameIndex);
121 void zoomIn();
122 void zoomOut();
123 bool eventFilter(QObject *target, QEvent *event);
124 void updateInformation(int objectId, int imageIndex, QTableWidget *table);
125 void correctTracking();
126 void nextOcclusionEvent();
128 void saveTrackedMovie();
129 void sliderConnection(const int index);
130 void clear();
131
132 signals:
133 void opened(bool);
134};
135
136#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
Definition: replay.h:73
bool eventFilter(QObject *target, QEvent *event)
Manages all the mouse input in the display.
Definition: replay.cpp:615
void loadTrackingDir(const QString &dir)
Loads a tracking analysis folder from a video file.
Definition: replay.cpp:456
void loadFrame(int frameIndex)
Displays the image and the tracking data in the ui->displayReplay. Triggered when the ui->replaySlide...
Definition: replay.cpp:491
QSize originalImageSize
Definition: replay.h:106
bool isReplayable
Definition: replay.h:101
vector< Point3i > colorMap
Definition: replay.h:97
QString memoryDir
Definition: replay.h:95
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:730
bool object
Definition: replay.h:104
QList< int > occlusionEvents
Definition: replay.h:98
QShortcut * deletedFrameFocus
Definition: replay.h:84
QSize resizedFrame
Definition: replay.h:105
void updateInformation(int objectId, int imageIndex, QTableWidget *table)
Update the information of an object inside a table widget.
Definition: replay.cpp:718
void saveTrackedMovie()
Saves the tracked movie in .avi. Triggered when ui->previousReplay is pressed.
Definition: replay.cpp:767
void openReplay()
Opens a dialogue to select a folder.
Definition: replay.cpp:359
void zoomIn()
Zooms in the display.
Definition: replay.cpp:588
void clear()
Clears replay data.
Definition: replay.cpp:379
void zoomOut()
Zooms out the display.
Definition: replay.cpp:600
void nextOcclusionEvent()
Finds and displays the next occlusion event on the ui->replayDisplay. Triggered when ui->nextReplay i...
Definition: replay.cpp:745
void loadReplay(const QString &dir)
Loads a video/images sequence and the last analysis performed.
Definition: replay.cpp:400
void previousOcclusionEvent()
Finds and displays the previous occlusion event on the ui->replayDisplay. Triggered when ui->previous...
Definition: replay.cpp:756
int currentIndex
Definition: replay.h:107
int autoPlayerIndex
Definition: replay.h:103
int maxIndex
Definition: replay.h:100
int replayNumberObject
Definition: replay.h:99
void openTrackingDir()
Opens a dialogue to select a Tracking_Result dir, necessitate a video already opened and matching tra...
Definition: replay.cpp:369
int replayFps
Definition: replay.h:102
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:34