13#include <QCoreApplication>
14#include <QDoubleSpinBox>
15#include <QDoubleValidator>
25#include <QtConcurrent/QtConcurrentMap>
31#include <opencv2/core/mat.hpp>
32#include <opencv2/video.hpp>
36#include "flowcalculator.h"
37#include "ialgorithm.h"
38#include "imagegatherer.h"
41#define PLUGIN_NAME QObject::tr("Smooth camera movement")
43#define SELECTOR_LABEL_TEXT QObject::tr("Movement Threshold")
44#define SELECTOR_DESCRIPTION \
46 "A resolution dependend threshold, that specifies when there was " \
47 "enough movement to set a new keyframe.")
48#define DESCRIPTION_STYLE \
49 "color: rgb(58, 58, 58); border-left: 6px solid rgb(58, 58, 58); " \
50 "border-top-right-radius: 5px; border-bottom-right-radius: 5px; " \
51 "background-color: lightblue;"
53 "color: rgb(58, 58, 58); border-left: 6px solid rgb(58, 58, 58); " \
54 "border-top-right-radius: 5px; border-bottom-right-radius: 5px; " \
55 "background-color: lightGreen;"
57#define BUFFER_NAME "SmoothCameraMovementBuffer"
58#define DELIMITER_COORDINATE "|"
59#define DELIMITER_ENTITY ","
61#define SETTINGS_SELECTOR_THRESHOLD "Selector threshold"
63#define LF_OPT_FLOW_TOTAL "Flow calculation"
64#define LF_SELECT_FRAMES "Selection of keyframes"
65#define LF_CE_TYPE_ADDITIONAL_INFO "Additional Computation Information"
66#define LF_CE_VALUE_USED_BUFFERED "Used buffered values"
67#define LF_CE_TYPE_DEBUG "Debug Information"
68#define LF_CE_NAME_FLOWVALUE "Flow value"
69#define LF_TIMER_BUFFER "Update Buffer"
70#define LF_TIMER_CORE "Core Computation"
71#define LF_TIMER_SELECTION "Keyframe selection"
88 Q_PLUGIN_METADATA(IID
"iVS3D.IAlgorithm")
123 std::vector<uint>
sampleImages(
const std::vector<uint> &imageList,
125 volatile bool *stopped,
bool useCuda,
132 QString
getName()
const override;
153 void setSettings(QMap<QString, QVariant> settings)
override;
166 volatile bool *stopped)
override;
176 double m_selectorThreshold = 2.0;
177 Reader *m_reader =
nullptr;
178 QPoint m_inputResolution = QPoint(0, 0);
179 cv::SparseMat m_bufferMat;
182 QWidget *m_settingsWidget =
nullptr;
183 QDoubleSpinBox *m_selectorThresholdSpinBox =
nullptr;
185 long m_durationFarnebackMs = 0;
186 long m_durationComputationFlowMs = 0;
189 void reportProgress(QString op,
int progress,
Progressable *receiver);
190 void displayMessage(QString txt,
Progressable *receiver);
191 void createSettingsWidget(QWidget *parent);
212 QVariant bufferMatToVariant(cv::SparseMat bufferMat);
214 void changeUIParameter(QVariant nValue, QString paramName,
215 QString selectorName);
The IAlgorithm interface is used to include plugin implementations for different sampling algorithms....
Definition ialgorithm.h:35
The LogFileParent class logs progress as well as information about a process (e.g....
Definition LogFileParent.h:30
The Progressable interface is used to by multithreaded actions such as sampling or exporting to repor...
Definition progressable.h:18
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
Definition smoothcontroller.h:86
void stringToBufferMat(QString string)
recreateMovementFromString is used to extract the movement value from a string and write it in the bu...
Definition smoothcontroller.cpp:280
QWidget * getSettingsWidget(QWidget *parent) override
getSettingsWidget creates a Widget, which can be used to change the algorithm parameters and returns ...
Definition smoothcontroller.cpp:11
Q_INTERFACES(IAlgorithm) public ~SmoothController()
StationaryCamera Constructor sets default values for member variables.
Definition smoothcontroller.h:99
std::vector< uint > sampleImages(const std::vector< uint > &imageList, Progressable *receiver, volatile bool *stopped, bool useCuda, LogFileParent *logFile) override
sampleImages selects keyframe if the camera is currently not stationary
Definition smoothcontroller.cpp:18
void setSettings(QMap< QString, QVariant > settings) override
setter for plugin's settings settings structure: <QMap> settings (all settings) <QVariant> selector_t...
Definition smoothcontroller.cpp:195
SmoothController()
StationaryCamera Constructor sets default values for member variables.
Definition smoothcontroller.cpp:3
QMap< QString, QVariant > sendBuffer()
sendBuffer Sends all buffered values for storeing previously calculated Infos
Definition smoothcontroller.cpp:167
QString getName() const override
getName Returns a name for displaying this algorithm to the user.
Definition smoothcontroller.cpp:165
QMap< QString, QVariant > getSettings() override
getter for plugin's settings
Definition smoothcontroller.cpp:208
QMap< QString, QVariant > generateSettings(Progressable *receiver, bool useCuda, volatile bool *stopped) override
generateSettings tries to generate the best settings for the current input
Definition smoothcontroller.cpp:200
void recreateBufferMatrix(QMap< QString, QVariant > buffer)
recreateBufferMatrix initalizes the buffer matix whith the new values from nBuffer
Definition smoothcontroller.cpp:263
void initialize(Reader *reader, QMap< QString, QVariant > buffer, signalObject *sigObj) override
initialize Sets up the default value which is corresponding to video information
Definition smoothcontroller.cpp:174
Definition signalobject.h:10