#include "Util/Types.H"
#include "Image/Pixels.H"
#include <complex>
Go to the source code of this file.
Functions | |
template<class T > | |
Image< T > | dogFilterHmax (const float theta, const float gamma, const int halfsize, const float div) |
Create a DoG kernel for HMax. | |
template<class T > | |
Image< T > | dogFilter (const float stddev, const float theta, const int halfsize=0) |
Create a DoG kernel; if halfsize is 0, compute it automatically. | |
template<class T > | |
Image< T > | dogFilter (const float stddev, const int halfsize=0) |
Create a non oriented DoG kernel; if halfsize is 0, compute it automatically. | |
template<class T > | |
Image< T > | dogFilterHmax (const float stddev, const float theta, const int cBegin, const int cEnd) |
Create a dog kernel for HMAX. | |
Image< PixRGB< byte > > | gaborFilterRGB (const float stddev, const float freq, const float theta, const float hueShift) |
template<class T > | |
Image< T > | gaborFilter (const float stddev, const float period, const float phase, const float theta, const float=0.0f, const float ampl=1.0f) |
Create a Gabor kernel. | |
template<class T > | |
Image< T > | gaborFilter (const float scale, const float theta) |
Create a Gabor kernel with a a given scale and angle (in radians). | |
template<class T > | |
Image< T > | gaborFilter2 (const float stddev, const float period, const float phase, const float theta, const float sigMod=1.0F, const float amplitude=1.0F) |
Create a Gabor kernel with default 1*sigma^2 instead of 2*sigma^2. | |
Image< float > | gaborFilter3 (const float major_stddev, const float minor_stddev, const float period, const float phase, const float theta, int size=-1) |
Produces a Gabor kernel with optionally unequal major+minor axis lengths. | |
template<class T > | |
Image< T > | gaussian2D (const float stddev, const float sigMod=1.0F, const float amplitude=255.0F) |
Create a 2D gaussian, compatible with gaborFilter2 for mask purposes. | |
template<class T > | |
Image< T > | gaussianBlob (const Dims &dims, const Point2D< int > ¢er, const float sigmaX, const float sigmaY) |
Create a 2D Gaussian blob centered at given coords. | |
template<class T > | |
Image< T > | gaussianBlobUnnormalized (const Dims &dims, const Point2D< int > ¢er, const float sigmaX, const float sigmaY) |
Create a 2D Gaussian blob centered at given coords, with peak value = 1.0. | |
Image< float > | binomialKernel (const int sz) |
Create a 1D binomial distribution kernel (shape of sz-by-1). | |
template<class T > | |
Image< T > | grating (const int width, const int height, const float period, const float phase, const float theta) |
Create a sinusoidal grating. | |
template<class T > | |
Image< T > | gaussian (const float coeff, const float sigma, const int maxhw, const float threshperc=1.0) |
Generate 1D gaussian. | |
template<class T > | |
Image< T > | longRangeExcFilter (const float factor, const float orient) |
Build a long-range excitatory filter. | |
template<class T > | |
Image< T > | fixationMask (const Dims &dims, const Point2D< int > &fixation, const float pixperdeg, const T maxval, const float sigma=0.5f) |
Generate a fixation mask, i.e., a Gaussian blob. | |
template<class T > | |
Image< T > | fixationMask (const Image< T > &mask, const Point2D< int > &fixation, const float pixperdeg, const T maxval, const float sigma=0.5f) |
Generate a fixation mask, adding it to existing mask. | |
Image< byte > | twofiftyfives (Dims d) |
Return an image of Dimensions d filled with 255s. | |
Image< byte > | twofiftyfives (int w, int h) |
Return an image of width w and height h filled with 255s. | |
Image< byte > | twofiftyfives (int w) |
Return a square image of width w filled with 255s. |
Functions to construct various kinds of filter kernels
Definition in file Kernels.H.
Image<float> binomialKernel | ( | const int | sz | ) |
Create a 1D binomial distribution kernel (shape of sz-by-1).
These kernels are normalized to sum to 1, and are used (implicitly) in the various lowPass*() functions.
Definition at line 502 of file Kernels.C.
References ASSERT, NO_INIT, and Image< T >::setVal().
Image<T> dogFilter | ( | const float | stddev, | |
const int | halfsize = 0 | |||
) | [inline] |
Create a non oriented DoG kernel; if halfsize is 0, compute it automatically.
Definition at line 123 of file Kernels.C.
References Image< T >::beginw(), exp(), and NO_INIT.
Image<T> dogFilter | ( | const float | stddev, | |
const float | theta, | |||
const int | halfsize = 0 | |||
) | [inline] |
Image<T> dogFilterHmax | ( | const float | stddev, | |
const float | theta, | |||
const int | cBegin, | |||
const int | cEnd | |||
) | [inline] |
Image<T> dogFilterHmax | ( | const float | theta, | |
const float | gamma, | |||
const int | halfsize, | |||
const float | div | |||
) | [inline] |
Image<T> fixationMask | ( | const Image< T > & | mask, | |
const Point2D< int > & | fixation, | |||
const float | pixperdeg, | |||
const T | maxval, | |||
const float | sigma = 0.5f | |||
) | [inline] |
Generate a fixation mask, adding it to existing mask.
Definition at line 614 of file Kernels.C.
References Image< T >::beginw(), exp(), Image< T >::getHeight(), Image< T >::getWidth(), Point2D< T >::i, and sqrt().
Image<T> gaborFilter | ( | const float | scale, | |
const float | theta | |||
) | [inline] |
Create a Gabor kernel with a a given scale and angle (in radians).
Definition at line 193 of file Kernels.C.
References Image< T >::beginw(), exp(), and NO_INIT.
Image<T> gaborFilter | ( | const float | stddev, | |
const float | period, | |||
const float | phase, | |||
const float | theta, | |||
const | float = 0.0f , |
|||
const float | ampl = 1.0f | |||
) | [inline] |
Image<T> gaborFilter2 | ( | const float | stddev, | |
const float | period, | |||
const float | phase, | |||
const float | theta, | |||
const float | sigMod = 1.0F , |
|||
const float | amplitude = 1.0F | |||
) | [inline] |
Create a Gabor kernel with default 1*sigma^2 instead of 2*sigma^2.
this is essentailly used in some psycho metric experiments (for instance , Polat and Sagi, 1994) instead of 2*sigma^2 so it is included here, if your weird you may make sigMod something other than 1.0 (or 2.0). As always feel free to be loopy
Definition at line 321 of file Kernels.C.
References Image< T >::beginw(), exp(), log(), NO_INIT, psi(), and sqrt().
Image<float> gaborFilter3 | ( | const float | major_stddev, | |
const float | minor_stddev, | |||
const float | period, | |||
const float | phase, | |||
const float | theta, | |||
int | size = -1 | |||
) |
Produces a Gabor kernel with optionally unequal major+minor axis lengths.
size | determines the filter size (in pixels) - in the default case (-1), the size is computed from the stddev |
Definition at line 352 of file Kernels.C.
References Image< T >::beginw(), exp(), log(), mean(), NO_INIT, psi(), and sqrt().
Image<T> gaussian | ( | const float | coeff, | |
const float | sigma, | |||
const int | maxhw, | |||
const float | threshperc = 1.0 | |||
) | [inline] |
Generate 1D gaussian.
coeff | a coefficient so that the peak of the Gaussian has the value coeff. If coeff is given as 0.0, then it will be computed internally as 1/(sigma*sqrt(2*pi)), i.e., the normal Gaussian coefficient. | |
sigma | the Gaussian standard deviation, in pixels | |
maxhw | maximum allower filter half-width. If maxhw is 0 there is no limit. | |
threshperc | cut the spatial extent of the kernel so that only values greater than threshperc times the max remain in the kernel. This allows us to automatically compute the appropriate kernel size to use for a given sigma and approximation tolerance given by threshpec. |
Definition at line 548 of file Kernels.C.
References exp(), log(), NO_INIT, Image< T >::setVal(), and sqrt().
Image<T> gaussian2D | ( | const float | stddev, | |
const float | sigMod = 1.0F , |
|||
const float | amplitude = 255.0F | |||
) | [inline] |
Image<T> gaussianBlob | ( | const Dims & | dims, | |
const Point2D< int > & | center, | |||
const float | sigmaX, | |||
const float | sigmaY | |||
) | [inline] |
Create a 2D Gaussian blob centered at given coords.
Definition at line 421 of file Kernels.C.
References Dims::h(), Point2D< T >::i, NO_INIT, Image< T >::setVal(), and Dims::w().
Image<T> gaussianBlobUnnormalized | ( | const Dims & | dims, | |
const Point2D< int > & | center, | |||
const float | sigmaX, | |||
const float | sigmaY | |||
) | [inline] |
Create a 2D Gaussian blob centered at given coords, with peak value = 1.0.
Definition at line 445 of file Kernels.C.
References Dims::h(), Point2D< T >::i, NO_INIT, Image< T >::setVal(), and Dims::w().
Image<T> grating | ( | const int | width, | |
const int | height, | |||
const float | period, | |||
const float | phase, | |||
const float | theta | |||
) | [inline] |
Create a sinusoidal grating.
Definition at line 525 of file Kernels.C.
References Image< T >::beginw(), NO_INIT, and psi().
Image<T> longRangeExcFilter | ( | const float | factor, | |
const float | orient | |||
) | [inline] |