The NthFrame class implements the IAlgorithm plugin interface and provides functionality needed to select every Nth frame as keyframe. The class also provides methods for changing N and visualizing the plugin in the core application using the name and settings.
More...
#include <nthframe.h>
|
|
| NthFrame () |
| | NthFrame Contructor to create an instance with N initialized to 1.
|
| |
| QWidget * | getSettingsWidget (QWidget *parent) |
| | showSettings Show a SettingsDialog to the user. This allows to change the value of N.
|
| |
| std::vector< uint > | sampleImages (const std::vector< unsigned int > &imageList, Progressable *receiver, volatile bool *stopped, bool useCuda, LogFileParent *logFile) override |
| | sampleImages Create an keyframe list with indices to every nth sharp image. Sharp images are specified by index in sharpImages list. The algorithm reports progress to the Progressable *receiver by calling Progressable::slot_makeProgress. Setting the *stopped bool to true exits the algorithm.
|
| |
| QString | getName () const override |
| | getName Returns the plugin Name
|
| |
| void | initialize (Reader *reader, QMap< QString, QVariant > buffer, signalObject *sigObj) override |
| | initialize Blur doesn't use this currently
|
| |
| void | setSettings (QMap< QString, QVariant > settings) override |
| | setter for plugin's settings
|
| |
| QMap< QString, QVariant > | generateSettings (Progressable *receiver, bool useCuda, volatile bool *stopped) override |
| | generateSettings tries to generate the best settings for the current input
|
| |
| QMap< QString, QVariant > | getSettings () override |
| | getter for plugin's settings
|
| |
| virtual std::vector< uint > | sampleImages (const std::vector< uint > &imageList, Progressable *receiver, volatile bool *stopped, bool useCuda, LogFileParent *logFile)=0 |
| | sampleImages selects the keyframes from the given images. The computation is based on the images provided by the given Reader. The imageList provides indices for the currently selected keyframes. This way the current selection can be taken in account in the calculation. Since the algorithm can be very time consuming, it is recommended to report progress to the given Progressable by invoking Progressable::slot_makeProgress. It should be possible to abort calculation by setting the value of stopped to true. Therefore it is necessary to repeatedly check its state. To speedup calculation, data can be buffered to accelerate the next call of sampleImages. On some systems the gpu can be utilized for acceleration as well, but only if useCuda is true. See following example implementation for sampleImages:
|
| |
|
| void | updateKeyframes (std::vector< uint > keyframes) |
| | updateKeyframes updates the keyframe list in the core object.
|
| |
| void | updateBuffer (QMap< QString, QVariant > buffer) |
| | updateBuffer stores the given buffer for future uses of the buffered data.
|
| |
The NthFrame class implements the IAlgorithm plugin interface and provides functionality needed to select every Nth frame as keyframe. The class also provides methods for changing N and visualizing the plugin in the core application using the name and settings.
- Author
- Dominik Wüst
- Date
- 2021/02/14
◆ generateSettings()
| QMap< QString, QVariant > NthFrame::generateSettings |
( |
Progressable * |
receiver, |
|
|
bool |
useCuda, |
|
|
volatile bool * |
stopped |
|
) |
| |
|
overridevirtual |
generateSettings tries to generate the best settings for the current input
- Parameters
-
| receiver | is a progressable, which displays the already made progress |
| buffer | QVariant with the buffered data form last call to sampleImages |
| useCuda | true if cv::cuda can be used |
| stopped | is set if the algorithm should abort |
- Returns
- QMap with the settings
Implements IAlgorithm.
◆ getName()
| QString NthFrame::getName |
( |
| ) |
const |
|
overridevirtual |
getName Returns the plugin Name
- Returns
- "Blur"
Implements IAlgorithm.
◆ getSettings()
| QMap< QString, QVariant > NthFrame::getSettings |
( |
| ) |
|
|
overridevirtual |
getter for plugin's settings
- Returns
- QMap with the settings
Implements IAlgorithm.
◆ getSettingsWidget()
| QWidget * NthFrame::getSettingsWidget |
( |
QWidget * |
parent | ) |
|
|
virtual |
showSettings Show a SettingsDialog to the user. This allows to change the value of N.
- Parameters
-
| parent | The parent widget for the SettingsDialog. This is needed to determin style and visibility. |
Implements IAlgorithm.
◆ initialize()
| void NthFrame::initialize |
( |
Reader * |
reader, |
|
|
QMap< QString, QVariant > |
buffer, |
|
|
signalObject * |
sigObj |
|
) |
| |
|
overridevirtual |
initialize Blur doesn't use this currently
- Parameters
-
| reader | the images |
| buffer | is a QVariant, which holds previous computions that could be usefull for the next selection |
| sigObj | provides signals from the core |
Implements IAlgorithm.
◆ sampleImages()
| std::vector< uint > NthFrame::sampleImages |
( |
const std::vector< unsigned int > & |
imageList, |
|
|
Progressable * |
receiver, |
|
|
volatile bool * |
stopped, |
|
|
bool |
useCuda, |
|
|
LogFileParent * |
logFile |
|
) |
| |
|
override |
sampleImages Create an keyframe list with indices to every nth sharp image. Sharp images are specified by index in sharpImages list. The algorithm reports progress to the Progressable *receiver by calling Progressable::slot_makeProgress. Setting the *stopped bool to true exits the algorithm.
- Parameters
-
| imageList | is a preselection of frames |
| receiver | is a progressable, which displays the already made progress |
| stopped | Pointer to a bool indication if user wants to stop the computation |
| useCuda | defines if the compution should run on graphics card |
| logFile | can be used to protocoll progress or problems |
- Returns
- A list of indices, which represent the selected keyframes.
◆ setSettings()
| void NthFrame::setSettings |
( |
QMap< QString, QVariant > |
settings | ) |
|
|
overridevirtual |
setter for plugin's settings
- Parameters
-
Implements IAlgorithm.
The documentation for this class was generated from the following files:
- iVS3D/src/iVS3D-nthFramePlugin/nthframe.h
- iVS3D/src/iVS3D-nthFramePlugin/nthframe.cpp