iVS3D v2.0.0
Loading...
Searching...
No Matches
NthFrame Class Reference

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>

Inheritance diagram for NthFrame:
IAlgorithm

Public Member Functions

 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
 
- Public Member Functions inherited from IAlgorithm
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:
 

Additional Inherited Members

- Signals inherited from IAlgorithm
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.
 

Detailed Description

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

Member Function Documentation

◆ 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
receiveris a progressable, which displays the already made progress
bufferQVariant with the buffered data form last call to sampleImages
useCudatrue if cv::cuda can be used
stoppedis 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
parentThe 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
readerthe images
bufferis a QVariant, which holds previous computions that could be usefull for the next selection
sigObjprovides 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
imageListis a preselection of frames
receiveris a progressable, which displays the already made progress
stoppedPointer to a bool indication if user wants to stop the computation
useCudadefines if the compution should run on graphics card
logFilecan 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
QMapwith the settings

Implements IAlgorithm.


The documentation for this class was generated from the following files: