Basic Image AlgorithmS Library
2.8.0
|
recursive approximation of gaussian blur (IIR) opencl implementation of deriche, recursively implementing the gaussian and its derivatives (icip, 1992) More...
#include <OpenCLFramework/Algorithm/clfRecursiveGauss.hh>
Public Member Functions | |
clfRecursiveGauss (float sigma=2.0f, clfContext *ctx=NULL, bool sharedGL=false, unsigned int device=0) | |
constructor, give context or let More... | |
int | Filter (clfImage2D *src, clfImage2D *&dst) |
gauss filter rgba image More... | |
int | FilterGrey (clfImage2D *src, clfImage2D *&dst) |
optimized gauss filter for grey images More... | |
int | FilterGreyColPacked (clfImage2D *src, clfImage2D *&dst) |
optimized gauss filter for already packed grey images More... | |
int | FilterX (clfImage2D *src, clfImage2D *&dst) |
filter in X-direction More... | |
int | FilterY (clfImage2D *src, clfImage2D *&dst) |
filter in Y-direction More... | |
clfProgram * | GetCLProgram () |
clfContext * | GetContext () |
void | Reset () |
clear intermediate images resets storage of internal images, needs to be called if image sizes differ from frame to frame More... | |
void | SetSigma (float sigma, int order=0) |
Set Sigma and calculate coefficients for iir filter. More... | |
virtual | ~clfRecursiveGauss () |
Static Public Member Functions | |
static void | getlocsize (const unsigned int val, unsigned int &result) |
static unsigned int | getlocsize (const unsigned int val) |
Protected Member Functions | |
void | InitInternal_ (clfContext *ctx, bool sharedGL, unsigned int device) |
Protected Attributes | |
clfContext * | context_ |
int | device_ |
clfImage2D * | intermediateImage_ |
bool | isSharedGL_ |
std::vector< std::string > | kernelNames_ |
int | maxComputeUnits_ |
clfImage2D * | oneDirFilteredImage_ |
bool | ownContext_ |
clfImage2D * | packedGreyImage_ |
std::vector< float > | params_ |
clfProgram * | programCL_ |
recursive approximation of gaussian blur (IIR) opencl implementation of deriche, recursively implementing the gaussian and its derivatives (icip, 1992)
Definition at line 20 of file clfRecursiveGauss.hh.
clfRecursiveGauss::clfRecursiveGauss | ( | float | sigma = 2.0f , |
clfContext * | ctx = NULL , |
||
bool | sharedGL = false , |
||
unsigned int | device = 0 |
||
) |
constructor, give context or let
Definition at line 15 of file clfRecursiveGauss.cpp.
References BIAS::clfProgram::AddKernel(), BIAS::clfProgram::AddKernels(), BIAS::clfProgram::AddSource(), BIAS::clfProgram::Build(), intermediateImage_, kernelNames_, oneDirFilteredImage_, packedGreyImage_, BIAS::clfAlgorithm::programCL_, and SetSigma().
|
virtual |
Definition at line 46 of file clfRecursiveGauss.cpp.
References Reset().
int clfRecursiveGauss::Filter | ( | clfImage2D * | src, |
clfImage2D *& | dst | ||
) |
gauss filter rgba image
Definition at line 60 of file clfRecursiveGauss.cpp.
References FilterX(), FilterY(), BIAS::clfImage2D::GetImageDim(), and oneDirFilteredImage_.
int clfRecursiveGauss::FilterGrey | ( | clfImage2D * | src, |
clfImage2D *& | dst | ||
) |
optimized gauss filter for grey images
Definition at line 128 of file clfRecursiveGauss.cpp.
References BIAS::clfImage2D::AllocateFromTemplate(), BIAS::clfAlgorithm::context_, BIAS::clfContext::CreateImage2D(), BIAS::clfImage2D::GetImageDim(), intermediateImage_, BIAS::clfMemory::IsReadOnly(), BIAS::clfProgram::KernelSetArgument(), oneDirFilteredImage_, packedGreyImage_, BIAS::clfAlgorithm::programCL_, BIAS::clfContext::RunOn1DRange(), and BIAS::clfContext::RunOn2DRange().
int clfRecursiveGauss::FilterGreyColPacked | ( | clfImage2D * | src, |
clfImage2D *& | dst | ||
) |
optimized gauss filter for already packed grey images
Definition at line 216 of file clfRecursiveGauss.cpp.
References BIAS::clfImage2D::Allocate(), BIAS::clfImage2D::AllocateFromTemplate(), BIAS::clfImage2D::ColorModel(), BIAS::clfAlgorithm::context_, BIAS::clfImage2D::CopyToImage(), BIAS::clfContext::CreateImage2D(), BIAS::clfContext::Finish(), BIAS::clfImage2D::GetImageDim(), intermediateImage_, BIAS::clfMemory::IsReadOnly(), BIAS::clfProgram::KernelSetArgument(), oneDirFilteredImage_, packedGreyImage_, BIAS::clfAlgorithm::programCL_, BIAS::clfContext::RunOn1DRange(), BIAS::clfContext::RunOn2DRange(), and BIAS::clfImage2D::StorageType().
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute().
int clfRecursiveGauss::FilterX | ( | clfImage2D * | src, |
clfImage2D *& | dst | ||
) |
filter in X-direction
Definition at line 75 of file clfRecursiveGauss.cpp.
References BIAS::clfImage2D::AllocateFromTemplate(), BIAS::clfAlgorithm::context_, BIAS::clfContext::CreateImage2D(), BIAS::clfImage2D::GetImageDim(), intermediateImage_, BIAS::clfProgram::KernelSetArgument(), BIAS::clfAlgorithm::programCL_, and BIAS::clfContext::RunOn1DRange().
Referenced by Filter().
int clfRecursiveGauss::FilterY | ( | clfImage2D * | src, |
clfImage2D *& | dst | ||
) |
filter in Y-direction
Definition at line 100 of file clfRecursiveGauss.cpp.
References BIAS::clfImage2D::AllocateFromTemplate(), BIAS::clfAlgorithm::context_, BIAS::clfContext::CreateImage2D(), BIAS::clfImage2D::GetImageDim(), intermediateImage_, BIAS::clfProgram::KernelSetArgument(), BIAS::clfAlgorithm::programCL_, and BIAS::clfContext::RunOn1DRange().
Referenced by Filter().
|
inlineinherited |
Definition at line 25 of file clfAlgorithm.hh.
|
inlineinherited |
Definition at line 23 of file clfAlgorithm.hh.
|
staticinherited |
Definition at line 53 of file clfAlgorithm.cpp.
|
staticinherited |
Definition at line 57 of file clfAlgorithm.cpp.
|
protectedinherited |
Definition at line 33 of file clfAlgorithm.cpp.
References BIAS::clfAlgorithm::context_, BIAS::clfContext::CreateProgram(), BIAS::clfAlgorithm::device_, BIAS::clfContext::GetDeviceInfo(), BIAS::clfAlgorithm::isSharedGL_, BIAS::clfContext::IsSharedGLContext(), clfDeviceInfo::maxComputeUnits, BIAS::clfAlgorithm::maxComputeUnits_, BIAS::clfAlgorithm::ownContext_, BIAS::clfAlgorithm::programCL_, and BIAS::clfContext::SetActiveDevice().
Referenced by BIAS::clfAlgorithm::clfAlgorithm().
void clfRecursiveGauss::Reset | ( | ) |
clear intermediate images resets storage of internal images, needs to be called if image sizes differ from frame to frame
Definition at line 50 of file clfRecursiveGauss.cpp.
References intermediateImage_, oneDirFilteredImage_, and packedGreyImage_.
Referenced by ~clfRecursiveGauss().
void clfRecursiveGauss::SetSigma | ( | float | sigma, |
int | order = 0 |
||
) |
Set Sigma and calculate coefficients for iir filter.
sigma | gaussian sigma |
order | derivative |
Definition at line 314 of file clfRecursiveGauss.cpp.
References kernelNames_, BIAS::clfProgram::KernelSetArgument(), params_, and BIAS::clfAlgorithm::programCL_.
Referenced by clfRecursiveGauss().
|
protectedinherited |
Definition at line 34 of file clfAlgorithm.hh.
Referenced by BIAS::clfRadixSort::ApplyPermutation(), BIAS::clfAlgorithm::clfAlgorithm(), BIAS::clfRadixSort::clfRadixSort(), BIAS::clfUnifiedMultilateralFilter::clfUnifiedMultilateralFilter(), BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfCopy::Copy(), BIAS::clfImageOperator::CutOffMinThreshold(), BIAS::clfImageOperator::Difference(), FilterGrey(), FilterGreyColPacked(), FilterX(), FilterY(), BIAS::clfRadixSort::Histogram(), BIAS::clfRadixSort::Host2GPU(), BIAS::clfUnifiedMultilateralFilter::Init(), BIAS::clfUnifiedMultilateralFilter::InitColorFilter(), BIAS::clfUnifiedMultilateralFilter::InitCredibilityFilter(), BIAS::clfUnifiedMultilateralFilter::InitDepthFilter(), BIAS::clfAlgorithm::InitInternal_(), BIAS::clfUnifiedMultilateralFilter::InitSpatialFilter(), BIAS::clfRadixSort::RecupGPU(), BIAS::clfRadixSort::Reorder(), BIAS::clfRadixSort::ScanHistogram(), BIAS::clfRadixSort::SetData(), BIAS::clfRadixSort::Transpose(), and BIAS::clfAlgorithm::~clfAlgorithm().
|
protectedinherited |
Definition at line 39 of file clfAlgorithm.hh.
Referenced by BIAS::clfAlgorithm::clfAlgorithm(), and BIAS::clfAlgorithm::InitInternal_().
|
protected |
Definition at line 67 of file clfRecursiveGauss.hh.
Referenced by clfRecursiveGauss(), FilterGrey(), FilterGreyColPacked(), FilterX(), FilterY(), and Reset().
|
protectedinherited |
Definition at line 37 of file clfAlgorithm.hh.
Referenced by BIAS::clfAlgorithm::clfAlgorithm(), and BIAS::clfAlgorithm::InitInternal_().
|
protected |
Definition at line 74 of file clfRecursiveGauss.hh.
Referenced by clfRecursiveGauss(), and SetSigma().
|
protectedinherited |
Definition at line 38 of file clfAlgorithm.hh.
Referenced by BIAS::clfAlgorithm::clfAlgorithm(), and BIAS::clfAlgorithm::InitInternal_().
|
protected |
Definition at line 68 of file clfRecursiveGauss.hh.
Referenced by clfRecursiveGauss(), Filter(), FilterGrey(), FilterGreyColPacked(), and Reset().
|
protectedinherited |
Definition at line 36 of file clfAlgorithm.hh.
Referenced by BIAS::clfAlgorithm::clfAlgorithm(), BIAS::clfAlgorithm::InitInternal_(), and BIAS::clfAlgorithm::~clfAlgorithm().
|
protected |
Definition at line 70 of file clfRecursiveGauss.hh.
Referenced by clfRecursiveGauss(), FilterGrey(), FilterGreyColPacked(), and Reset().
|
protected |
Definition at line 72 of file clfRecursiveGauss.hh.
Referenced by SetSigma().
|
protectedinherited |
Definition at line 35 of file clfAlgorithm.hh.
Referenced by BIAS::clfRadixSort::ApplyPermutation(), BIAS::clfAlgorithm::clfAlgorithm(), BIAS::clfCopy::clfCopy(), BIAS::clfImageOperator::clfImageOperator(), BIAS::clfRadixSort::clfRadixSort(), clfRecursiveGauss(), BIAS::clfUnifiedMultilateralFilter::clfUnifiedMultilateralFilter(), BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfCopy::Copy(), BIAS::clfImageOperator::CutOffMinThreshold(), BIAS::clfImageOperator::Difference(), FilterGrey(), FilterGreyColPacked(), FilterX(), FilterY(), BIAS::clfRadixSort::Histogram(), BIAS::clfUnifiedMultilateralFilter::InitCredibilityFilter(), BIAS::clfAlgorithm::InitInternal_(), BIAS::clfRadixSort::Reorder(), BIAS::clfRadixSort::ScanHistogram(), SetSigma(), BIAS::clfRadixSort::Transpose(), and BIAS::clfAlgorithm::~clfAlgorithm().