iVS3D v2.0.0
Loading...
Searching...
No Matches
movementfactor.h
1#ifndef MOVEMENTFACTOR_H
2#define MOVEMENTFACTOR_H
3
4#include <QObject>
5
6#include "keyframeselector.h"
7#include "factory.h"
8
9#define SECTIONSIZEMAX_NAME "Maximum section size"
10#define SECTIONSIZEMAX_DESCRIPTION "Defines the maximum size in frames that a section can be."
11#define SECTIONSIZEMIN_NAME "Minimum section size"
12#define SECTIONSIZEMIN_DESCRIPTION "Defines the maximum size in frames that a section can be."
13#define ACCELERATION_NAME "Acceleration"
14#define ACCELERATION_DESCRIPTION "Frame pairs which have a lower acceleration between them than this factor will be grouped together as a section. The acceleration facotr of 1.0 represents no accleration."
15
27{
28 Q_OBJECT
29public:
30 explicit MovementFactor(Settings settings);
40 std::vector<uint> select(std::vector<uint> frameVector, std::vector<double> flowValues, volatile bool *stopped) override;
41private:
42 // member variables
43 QPair<int, int> m_sectionSize = {0, 0};
44 double m_acceleration = 1.0;
45 // functions
46 void readSettings(Settings settings);
47};
48
49static KeyframeSelector::Settings settings = {
50 KeyframeSelector::Parameter{SECTIONSIZEMIN_NAME, SECTIONSIZEMIN_DESCRIPTION, 0},
51 KeyframeSelector::Parameter{SECTIONSIZEMAX_NAME, SECTIONSIZEMAX_DESCRIPTION, 10},
52 KeyframeSelector::Parameter{ACCELERATION_NAME, ACCELERATION_DESCRIPTION, (double)1.5}
53};
54
55REGISTER_SELECTOR("MovementFactor selector", MovementFactor, settings)
56
57#endif // MOVEMENTFACTOR_H
The ImageGatherer class is an interface which defines the structure for the usecase specific algorith...
Definition keyframeselector.h:20
The MovementFactor class implements the KeyframeSelector interface. It selects frames based on the in...
Definition movementfactor.h:27
std::vector< uint > select(std::vector< uint > frameVector, std::vector< double > flowValues, volatile bool *stopped) override
select picks keyframes from the given frameVector
Definition movementfactor.cpp:8