ConvolutionKernel.hpp
1 #pragma once
2 
3 
4 //OPALS
5 #include "opals/config.hpp"
6 #include "opals/Array.hpp"
7 #include "opals/Path.hpp"
8 #include "opals/Vector.hpp"
9 
10 //boost
11 //#include <boost/numeric/ublas/matrix.hpp>
12 
13 namespace opals {
14 
15  /// Class describing different kernels for convolution filtering
16  class OPALS_API ConvolutionKernel
17  {
18  public:
19  typedef Array<unsigned,2> ArrayU2; ///< size array
20  //typedef boost::numeric::ublas::matrix<float> KMatrix; ///< kernel matrix
21  typedef Vector<float> KMatrix; ///< kernel matrix as vector of floats
22  enum KernelType{
23  average = 0,
24  gaussian,
25  fromFile,
26  userDefined };
27 
28  public:
29 
31 
32  virtual ~ConvolutionKernel();
33 
34  void setType( const unsigned& type ) { _type = (KernelType) type; };
35  unsigned getType() const { return _type; };
36 
37  void setSize( const ArrayU2& size ) { _size = size; };
38  ArrayU2 getSize() const { return _size; };
39 
40  void setKernelMatrix( const KMatrix& kmat ) { _kmatrix = kmat; };
41  KMatrix getKernelMatrix() const;
42 
43  void setImageFilename( const Path& imgfile );
44  opals::Path getImageFilename() const { return _imgfile;};
45 
46  void setParam( const Vector<float>& pars ) { _pars = pars; };
47  Vector<float> getParam() const { return _pars; };
48 
49  protected:
50  KernelType _type;
51  ArrayU2 _size;
52  KMatrix _kmatrix;
53  Path _imgfile;
54  Vector<float> _pars;
55  };
56 }
@ gaussian
Gaussian decomposition, standard.
def currentStep(self, step)
Definition: ControlObject.py:65
Class describing different kernels for convolution filtering.
Definition: ConvolutionKernel.hpp:16
currentStep_
Definition: ControlObject.py:13
def update(self, step)
Definition: ControlObject.py:39
goback_
Definition: ControlObject.py:19
stepCount_
Definition: ControlObject.py:12
Array< unsigned, 2 > ArrayU2
size array
Definition: ConvolutionKernel.hpp:19
def clear(self)
Definition: ControlObject.py:49
clearAfterFinish_
Definition: ControlObject.py:9
A file/directory path.
Definition: Path.hpp:26
lastUpdate
Definition: ControlObject.py:17
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
Vector< float > KMatrix
kernel matrix as vector of floats
Definition: ConvolutionKernel.hpp:21
updatePrecision_
Definition: ControlObject.py:10
hasBeenCleared_
Definition: ControlObject.py:11
format_
Definition: ControlObject.py:18
ODM like progress bar for the stdout stream.
Definition: ControlObject.py:7
def precision(self)
Definition: ControlObject.py:33
updateEvery_
Definition: ControlObject.py:16
def width(self)
Definition: ControlObject.py:27