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

The Blur class is responsible for selecting they keyframes based on the blu values calculated by a BlurAlgorithm. More...

#include <blur.h>

Inheritance diagram for Blur:
IAlgorithm

Public Slots

void slot_blurAlgoChanged (const QString &name)
 [slot] slot_blurAlgoChanged selects the algorithm identified by name.
 
void slot_wsChanged (int ws)
 [slot] slot_wsChanged updates the windowsize.
 
void slot_ldChanged (int ld)
 [slot] slot_ldChanged updates local deviation.
 
void slot_selectedImageIndex (uint index)
 [slot] slot_selectedImageIndex changes currently displayed info (blur value of current image)
 

Private Member Functions

Q_INTERFACES(IAlgorithm) public ~Blur ()
 Blur Constructor which creates an instance of every BlurAlgorithm and stets standard values (WindowSize = 30, LocalDeviation = 95)
 
QWidget * getSettingsWidget (QWidget *parent) override
 getSettingsWidget Returns the settings widget where BlurAlgorithm, WindowSizw and LocalDeviation can be set
 
std::vector< uint > sampleImages (const std::vector< unsigned int > &imageList, Progressable *receiver, volatile bool *stopped, bool useCuda, LogFileParent *logFile) override
 sampleImages selects keyframes based on their bluriness. It differs between a calulation on all images and a caculation only on keyframes.
 
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
 

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.
 
- 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:
 

Detailed Description

The Blur class is responsible for selecting they keyframes based on the blu values calculated by a BlurAlgorithm.

Author
Daniel Brommer
Date
2021/02/19

Member Function Documentation

◆ generateSettings()

QMap< QString, QVariant > Blur::generateSettings ( Progressable receiver,
bool  useCuda,
volatile bool *  stopped 
)
overrideprivatevirtual

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 Blur::getName ( ) const
overrideprivatevirtual

getName Returns the plugin Name

Returns
"Blur"

Implements IAlgorithm.

◆ getSettings()

QMap< QString, QVariant > Blur::getSettings ( )
overrideprivatevirtual

getter for plugin's settings

Returns
QMap with the settings

Implements IAlgorithm.

◆ getSettingsWidget()

QWidget * Blur::getSettingsWidget ( QWidget *  parent)
overrideprivatevirtual

getSettingsWidget Returns the settings widget where BlurAlgorithm, WindowSizw and LocalDeviation can be set

Parameters
parentParent of the created QWidget
Returns
The Settings Widget

Implements IAlgorithm.

◆ initialize()

void Blur::initialize ( Reader reader,
QMap< QString, QVariant >  buffer,
signalObject sigObj 
)
overrideprivatevirtual

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 > Blur::sampleImages ( const std::vector< unsigned int > &  imageList,
Progressable receiver,
volatile bool *  stopped,
bool  useCuda,
LogFileParent logFile 
)
overrideprivate

sampleImages selects keyframes based on their bluriness. It differs between a calulation on all images and a caculation only on keyframes.

If allImages are used, sampleImages calulates the blur value of every image with the selected BlurAlgorithm. Then it creates a window for every image x. This window is defined as [x - windowSize, .., x, .. , x + windowSize] (This window will be cropped to 0 on the left and picCOunt on the rigth side). For every window the average Blur values y of it's images is calculated. If (Blur value from x) / y >= LocalDeviation / 100 Image x is considered a sharpImage.

If only keyframes are used, sampleImages creates the same windows, but only for keyframes and it will selected the Image in a window with the largest blur value.

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 Blur::setSettings ( QMap< QString, QVariant >  settings)
overrideprivatevirtual

setter for plugin's settings

Parameters
QMapwith the settings

Implements IAlgorithm.

◆ slot_blurAlgoChanged

void Blur::slot_blurAlgoChanged ( const QString &  name)
slot

[slot] slot_blurAlgoChanged selects the algorithm identified by name.

Parameters
nameThe algorithm name

◆ slot_ldChanged

void Blur::slot_ldChanged ( int  ld)
slot

[slot] slot_ldChanged updates local deviation.

Parameters
ldThe new local deviation

◆ slot_selectedImageIndex

void Blur::slot_selectedImageIndex ( uint  index)
slot

[slot] slot_selectedImageIndex changes currently displayed info (blur value of current image)

Parameters
indexindex of the currently shown image

◆ slot_wsChanged

void Blur::slot_wsChanged ( int  ws)
slot

[slot] slot_wsChanged updates the windowsize.

Parameters
wsThe new windowsize

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