11#include <QCoreApplication>
12#include <QDoubleSpinBox>
23#include <opencv2/core/mat.hpp>
24#include <opencv2/video.hpp>
28#include "flowcalculator.h"
30#include "imagegatherer.h"
31#include "iselection.h"
34#define PLUGIN_NAME QObject::tr("Smooth camera movement")
36#define SELECTOR_LABEL_TEXT QObject::tr("Movement Threshold")
37#define SELECTOR_DESCRIPTION \
39 "A resolution dependend threshold, that specifies when there was " \
40 "enough movement to set a new keyframe.")
41#define DESCRIPTION_STYLE \
42 "color: rgb(58, 58, 58); border-left: 6px solid rgb(58, 58, 58); " \
43 "border-top-right-radius: 5px; border-bottom-right-radius: 5px; " \
44 "background-color: lightblue;"
46#define SETTINGS_SELECTOR_THRESHOLD "Selector threshold"
48#define LF_OPT_FLOW_TOTAL "Flow calculation"
49#define LF_SELECT_FRAMES "Selection of keyframes"
50#define LF_CE_TYPE_ADDITIONAL_INFO "Additional Computation Information"
51#define LF_CE_VALUE_USED_BUFFERED "Used buffered values"
52#define LF_CE_TYPE_DEBUG "Debug Information"
53#define LF_CE_NAME_FLOWVALUE "Flow value"
54#define LF_TIMER_BUFFER "Update Buffer"
55#define LF_TIMER_CORE "Core Computation"
56#define LF_TIMER_SELECTION "Keyframe selection"
71 Q_PLUGIN_METADATA(IID
"iVS3D.IBase")
80 QString
getName()
const override;
81 QMap<QString, QVariant>
getSettings()
const override;
83 const QMap<QString, QVariant>& settings)
override;
90 volatile bool& cancelFlag)
override;
93 void syncSettingsWidget(
double selectorThreshold);
96 void slot_selectorThresholdChanged(
double value);
99 std::unique_ptr<QWidget> createSettingsWidget();
100 void reportProgress(
const QString& op,
int progress);
103 double m_selectorThreshold = 2.0;
104 bool m_useCuda =
false;
105 Reader* m_reader =
nullptr;
106 QPoint m_inputResolution = QPoint(0, 0);
107 cv::SparseMat m_bufferMat;
109 QDoubleSpinBox* m_selectorThresholdSpinBox =
nullptr;
Implements smooth camera movement keyframe selection using PLUG::IBase + PLUG::ISelection.
Definition smoothcontroller.h:69
QMap< QString, QVariant > getSettings() const override
getSettings retrieves the current settings of the plugin as a map of key-value pairs....
Definition smoothcontroller.cpp:42
void onCudaChanged(bool enabled) override
onCudaChanged is called when the CUDA usage setting is changed in iVS3D.
Definition smoothcontroller.cpp:95
PLUG::SettingsWidgetResult getSettingsWidget() override
getSettingsWidget creates and returns a settings QWidget for this plugin.
Definition smoothcontroller.cpp:29
PLUG::InputLoadedResult onInputLoaded(const PLUG::InputData &input) override
onInputLoaded is called when a new input video or image set is loaded.
Definition smoothcontroller.cpp:68
PLUG::SelectionResult selectImages(const PLUG::SelectionData &data, volatile bool &cancelFlag) override
Selects images based on the provided selection data.
Definition smoothcontroller.cpp:97
QString getName() const override
getName returns the name of the plugin which will be displayed in the iVS3D interface.
Definition smoothcontroller.cpp:40
PLUG::ApplySettingsResult applySettings(const QMap< QString, QVariant > &settings) override
applySettings applies the provided settings to the plugin. This method is used to restore plugin conf...
Definition smoothcontroller.cpp:49
The IBase interface provides a base class for all plugin interfaces in iVS3D. It inherits from QObjec...
Definition ibase.h:102
Interface for keyframe/image-selection plugins in iVS3D.
Definition iselection.h:53
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
tl::expected< void, Error > InputLoadedResult
Type alias for the result of handling an input loaded event, which can be either a successful void re...
Definition ibase.h:58
tl::expected< void, Error > ApplySettingsResult
Type alias for the result of applying settings to a plugin, which can be either a successful void res...
Definition ibase.h:51
tl::expected< std::unique_ptr< QWidget >, Error > SettingsWidgetResult
Type alias for the result of a settings widget creation operation, which can be either a successful u...
Definition ibase.h:44
Data available for image selection in ISelection plugins.
Definition iselection.h:31