Image Component Library (ICL)
MotionSensitiveTemporalSmoothing.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLFilter/src/ICLFilter/MotionSensitiveTemporalSmoothi **
10 ** ng.h **
11 ** Module : ICLFilter **
12 ** Authors: Andre Ueckermann **
13 ** **
14 ** **
15 ** GNU LESSER GENERAL PUBLIC LICENSE **
16 ** This file may be used under the terms of the GNU Lesser General **
17 ** Public License version 3.0 as published by the **
18 ** **
19 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
20 ** included in the packaging of this file. Please review the **
21 ** following information to ensure the license requirements will **
22 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
23 ** **
24 ** The development of this software was supported by the **
25 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
26 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
27 ** Forschungsgemeinschaft (DFG) in the context of the German **
28 ** Excellence Initiative. **
29 ** **
30 ********************************************************************/
31 
32 #pragma once
33 
34 #include <ICLUtils/CompatMacros.h>
35 #include <ICLUtils/Uncopyable.h>
36 #include <ICLCore/Img.h>
37 #include <ICLFilter/UnaryOp.h>
38 
39 #ifdef ICL_HAVE_OPENCL
40 #include <ICLUtils/CLProgram.h>
41 #include <ICLUtils/CLKernel.h>
42 #include <ICLUtils/CLBuffer.h>
43 #endif
44 
45 namespace icl{
46  namespace filter{
47 
49  public:
50 
52 
55  TemporalSmoothingCL(utils::Size size, core::depth depth, int iMaxFilterSize, int iNullValue);
56 
59 
61 
63  core::Img32f temporalSmoothingF(const core::Img32f &inputImage);
64 
66 
68  core::Img8u temporalSmoothingC(const core::Img8u &inputImage);
69 
71 
72  void setUseCL(bool use);
73 
75 
76  void setFilterSize(int iFilterSize);
77 
79 
80  void setDifference(int iDifference);
81 
83 
84  core::Img32f getMotionImage();
85 
87 
88  bool isCLReady();
89 
91 
92  bool isCLActive();
93 
94  private:
95 
96  int w,h;
98  bool clReady;
99  bool useCL;
100 
101  int imgCount;
102 
106 
109 
110  std::vector<core::Img32f> inputImagesF;
112  std::vector<core::Img8u> inputImagesC;
115 
116  #ifdef ICL_HAVE_OPENCL
117  //OpenCL
121 
122  unsigned char* inputImage1ArrayC;
123  unsigned char* inputImagesArrayC;
124  unsigned char* outputImageArrayC;
125 
127 
128 
129  //OpenCL
135 
136  //OpenCL buffer
142  #endif
143 
144  };
145 
147  public:
148 
150 
152  MotionSensitiveTemporalSmoothing(int iNullValue, int iMaxFilterSize);
153 
156 
158 
162  virtual void apply(const core::ImgBase *src, core::ImgBase **dst);
163 
165  using UnaryOp::apply;
166 
168 
169  void setUseCL(bool use);
170 
172 
173  void setFilterSize(int filterSize);
174 
176 
177  void setDifference(int difference);
178 
180 
181  core::Img32f getMotionImage();
182 
184 
185  bool isCLActive();
186 
187  private:
188 
189  void init(int iChannels, core::depth iDepth, utils::Size iSize);
190 
191  bool useCL;
192 
195 
198 
202 
203  std::vector<TemporalSmoothingCL*> clPointer;
204  };
205 
206  } // namespace filter
207 }
Definition: MotionSensitiveTemporalSmoothing.h:48
float * outputImageArrayF
Definition: MotionSensitiveTemporalSmoothing.h:120
int imgCount
Definition: MotionSensitiveTemporalSmoothing.h:101
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
int maxFilterSize
Definition: MotionSensitiveTemporalSmoothing.h:105
bool clReady
Definition: MotionSensitiveTemporalSmoothing.h:98
bool useCL
Definition: MotionSensitiveTemporalSmoothing.h:191
core::Img8u outputImageC
Definition: MotionSensitiveTemporalSmoothing.h:113
Wrapper for an OpenCL Kernel.
Definition: CLKernel.h:72
int maxFilterSize
Definition: MotionSensitiveTemporalSmoothing.h:197
core::Img32f outputImageF
Definition: MotionSensitiveTemporalSmoothing.h:111
utils::CLBuffer inputImageBufferF
Definition: MotionSensitiveTemporalSmoothing.h:137
std::vector< TemporalSmoothingCL * > clPointer
Definition: MotionSensitiveTemporalSmoothing.h:203
std::vector< core::Img8u > inputImagesC
Definition: MotionSensitiveTemporalSmoothing.h:112
float * inputImage1ArrayF
Definition: MotionSensitiveTemporalSmoothing.h:118
Wrapper for an OpenCL Buffer.
Definition: CLBuffer.h:52
utils::CLKernel kernelTemporalSmoothingFloat
Definition: MotionSensitiveTemporalSmoothing.h:131
Abstract Base class for Unary Operators.
Definition: UnaryOp.h:51
Size class of the ICL.
Definition: Size.h:61
utils::CLBuffer inputImageBufferC
Definition: MotionSensitiveTemporalSmoothing.h:139
float * motionImageArray
Definition: MotionSensitiveTemporalSmoothing.h:126
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
utils::CLKernel kernelCheckRANSAC
Definition: MotionSensitiveTemporalSmoothing.h:133
int w
Definition: MotionSensitiveTemporalSmoothing.h:96
int nullValue
Definition: MotionSensitiveTemporalSmoothing.h:108
float * inputImagesArrayF
Definition: MotionSensitiveTemporalSmoothing.h:119
core::Img32f motionImage
Definition: MotionSensitiveTemporalSmoothing.h:114
utils::CLKernel kernelAssignRANSAC
Definition: MotionSensitiveTemporalSmoothing.h:134
int filterSize
Definition: MotionSensitiveTemporalSmoothing.h:103
int currentDifference
Definition: MotionSensitiveTemporalSmoothing.h:107
unsigned char * outputImageArrayC
Definition: MotionSensitiveTemporalSmoothing.h:124
utils::CLBuffer motionImageBuffer
Definition: MotionSensitiveTemporalSmoothing.h:141
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
unsigned char * inputImage1ArrayC
Definition: MotionSensitiveTemporalSmoothing.h:122
utils::CLProgram program
Definition: MotionSensitiveTemporalSmoothing.h:130
utils::Size size
Definition: MotionSensitiveTemporalSmoothing.h:200
utils::CLKernel kernelTemporalSmoothingChar
Definition: MotionSensitiveTemporalSmoothing.h:132
#define ICLFilter_API
Definition: CompatMacros.h:175
core::depth depth
Definition: MotionSensitiveTemporalSmoothing.h:201
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
int currentFilterSize
Definition: MotionSensitiveTemporalSmoothing.h:104
int nullValue
Definition: MotionSensitiveTemporalSmoothing.h:196
core::depth d
Definition: MotionSensitiveTemporalSmoothing.h:97
unsigned char * inputImagesArrayC
Definition: MotionSensitiveTemporalSmoothing.h:123
std::vector< core::Img32f > inputImagesF
Definition: MotionSensitiveTemporalSmoothing.h:110
utils::CLBuffer outputImageBufferC
Definition: MotionSensitiveTemporalSmoothing.h:140
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
Definition: MotionSensitiveTemporalSmoothing.h:146
Main class for OpenCL based accelleration.
Definition: CLProgram.h:259
int currentDifference
Definition: MotionSensitiveTemporalSmoothing.h:194
int currentFilterSize
Definition: MotionSensitiveTemporalSmoothing.h:193
utils::CLBuffer outputImageBufferF
Definition: MotionSensitiveTemporalSmoothing.h:138
bool useCL
Definition: MotionSensitiveTemporalSmoothing.h:99
int numChannels
Definition: MotionSensitiveTemporalSmoothing.h:199