#include "Image/Convolutions.H"
#include "Image/PyramidTypes.H"
#include "Util/Promotions.H"
#include "Util/Types.H"
Go to the source code of this file.
Enumerations | |
enum | GaborFlags { DO_ENERGY_NORM = 1, DO_LAPLACIAN = 2, DO_CLAMPED_DIFF = 4, NO_ABS = 8 } |
Functions | |
template<class T_or_RGB > | |
T_or_RGB | getPyrPixel (const ImageSet< T_or_RGB > &pyr, const Point2D< int > &p, const uint lev) |
Get value of a pixel from a dyadic pyramid at a given level and coordinates. | |
template<class T_or_RGB > | |
T_or_RGB | getPyrPixelNI (const ImageSet< T_or_RGB > &pyr, const Point2D< int > &p, const uint lev) |
Get value of a pixel from a dyadic pyramid at a given level and coordinates, no interpolation. | |
template<class T_or_RGB > | |
T_or_RGB | getPyrPixel (const ImageSet< T_or_RGB > &pyr, const float x, const float y, const float z) |
Get value of a pixel from a dyadic pyramid with trilinear interpolation. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrGaussian (const Image< T_or_RGB > &image, int firstlevel, int depth, int filterSize) |
Uses a Gaussian filter of size filterSize. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildRadialPyrGaussian (const Image< T_or_RGB > &image, int firstlevel, int depth) |
Uses a Gaussian filter of size 5 designed for radially transformed images. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrConvolve (const Image< T_or_RGB > &image, int firstlevel, int depth, const Image< float > &filter, ConvolutionBoundaryStrategy boundary) |
Uses an arbitrary filter given as argument. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrLaplacian (const Image< T_or_RGB > &image, int firstlevel, int depth, int filterSize) |
Uses a Laplacian filter of size filterSize. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrOrientedFromLaplacian (const ImageSet< T_or_RGB > &laplacian, int filterSize, float theta, float intens=10.0f, const bool usetab=false) |
Uses an oriented Laplacian filter with a given size/orientation/intensity. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrOriented (const Image< T_or_RGB > &image, int firstlevel, int depth, int filterSize, float theta, float intens=10.0f, const bool usetab=false) |
Uses an oriented Laplacian filter with a given size/orientation/intensity. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrLocalAvg (const Image< T_or_RGB > &image, int depth) |
Just fills the deepest level with the local image average at that scale. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrLocalAvg2x2 (const Image< T_or_RGB > &image, int depth) |
Each level contains local 2x2 averages of the previous level. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrLocalMax (const Image< T_or_RGB > &image, int depth) |
Just fills the deepest level with the local image maximum at that scale. | |
template<class T_or_RGB > | |
ImageSet< T_or_RGB > | buildPyrGeneric (const Image< T_or_RGB > &image, int firstlevel, int depth, const PyramidType typ, const float gabor_theta=0.0f, const float gabor_intens=10.0f) |
Build a pyramid of type given by the PyramidType. | |
ImageSet< float > | buildPyrGabor (const ImageSet< float > &gaussianPyr, float angle, float filter_period, float elongation=1.0, int size=-1, int flags=0) |
Build a Gabor Pyramid with a given angle, filter period and elongation. | |
ImageSet< float > | buildPyrGabor (const Image< float > &img, int firstlevel, int depth, float angle, float filter_period, float elongation=1.0, int size=-1, int flags=0) |
Build a Gabor Pyramid with a given angle, filter period and elongation. | |
template<class T > | |
Image< T > | centerSurround (const ImageSet< T > &pyr, const int lev1, const int lev2, const bool absol=false, const ImageSet< float > *clipPyr=0) |
Compute center-surround between images at lev1 and lev2. | |
template<class T > | |
void | centerSurround (const ImageSet< T > &pyr, const int lev1, const int lev2, Image< T > &pos, Image< T > &neg, const ImageSet< float > *clipPyr=0) |
Compute center-surround between images, splitting positive and negative. | |
template<class T > | |
Image< T > | centerSurroundSingleOpponent (const ImageSet< T > &cpyr, const ImageSet< T > &spyr, const int lev1, const int lev2, const bool absol=false, const ImageSet< float > *clipPyr=0) |
Compute single-opponent center-surround between images at lev1 and lev2. | |
template<class T > | |
void | centerSurroundSingleOpponent (const ImageSet< T > &cpyr, const ImageSet< T > &spyr, const int lev1, const int lev2, Image< T > &pos, Image< T > &neg, const ImageSet< float > *clipPyr=0) |
Compute single-opp center-surr between imgs, splitting pos and neg. | |
template<class T > | |
Image< T > | centerSurroundDiff (const ImageSet< T > &pyr1, const ImageSet< T > &pyr2, const int lev1, const int lev2, const bool absol=false, const ImageSet< float > *clipPyr=0) |
Compute center-surround between difference images at lev1 and lev2. | |
template<class T > | |
void | centerSurroundDiff (const ImageSet< T > &pyr1, const ImageSet< T > &pyr2, const int lev1, const int lev2, Image< T > &pos, Image< T > &neg, const ImageSet< float > *clipPyr=0) |
Compute center-surround differnces, splitting pos & neg values. | |
template<class T > | |
Image< T > | centerSurroundDiffSingleOpponent (const ImageSet< T > &cpyr1, const ImageSet< T > &cpyr2, const ImageSet< T > &spyr1, const ImageSet< T > &spyr2, const int lev1, const int lev2, const bool absol=false, const ImageSet< float > *clipPyr=0) |
Compute single-opp center-surround btw difference images at lev1 and lev2. | |
template<class T > | |
void | centerSurroundDiffSingleOpponent (const ImageSet< T > &cpyr1, const ImageSet< T > &cpyr2, const ImageSet< T > &spyr1, const ImageSet< T > &spyr2, const int lev1, const int lev2, Image< T > &pos, Image< T > &neg, const ImageSet< float > *clipPyr=0) |
Compute single-opp center-surround differnces, splitting pos & neg values. | |
template<class T_or_RGB > | |
Image< T_or_RGB > | weightedBlur (const Image< byte > &modulator, const ImageSet< T_or_RGB > &pyr) |
generate a weighted blur | |
template<class T_or_RGB > | |
Image< T_or_RGB > | foveate (const Image< byte > &mask, const ImageSet< T_or_RGB > &pyr) |
Generate a foveation blur. |
Free functions operating on pyramid data structures
Definition in file PyramidOps.H.
ImageSet<T_or_RGB> buildPyrConvolve | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth, | |||
const Image< float > & | filter, | |||
ConvolutionBoundaryStrategy | boundary | |||
) | [inline] |
Uses an arbitrary filter given as argument.
Referenced by RGBConvolvePyrBuilder< T >::build(), ConvolvePyrBuilder< T >::build(), and RGBConvolvePyrBuilder< T >::build2().
ImageSet<float> buildPyrGabor | ( | const Image< float > & | img, | |
int | firstlevel, | |||
int | depth, | |||
float | angle, | |||
float | filter_period, | |||
float | elongation = 1.0 , |
|||
int | size = -1 , |
|||
int | flags = 0 | |||
) |
Build a Gabor Pyramid with a given angle, filter period and elongation.
size | determines the filter size (in pixels) - in the default case (-1), the size is computed from the filter_preiod and elongation |
Definition at line 482 of file PyramidOps.C.
References buildPyrGabor(), buildPyrGaussian(), and buildPyrLaplacian().
ImageSet<float> buildPyrGabor | ( | const ImageSet< float > & | gaussianPyr, | |
float | angle, | |||
float | filter_period, | |||
float | elongation = 1.0 , |
|||
int | size = -1 , |
|||
int | flags = 0 | |||
) |
Build a Gabor Pyramid with a given angle, filter period and elongation.
size | determines the filter size (in pixels) - in the default case (-1), the size is computed from the filter_period and elongation |
Definition at line 406 of file PyramidOps.C.
References abs(), energyNorm(), Image< T >::getHeight(), Image< T >::getWidth(), optConvolve(), and ImageSet< T >::size().
Referenced by SpatioTemporalEnergyPyrBuilder< T >::build(), GaborPyrBuilder< T >::build(), buildPyrGabor(), ContourChannel::doInput(), and GaborPyrBuilder< T >::input().
ImageSet<T_or_RGB> buildPyrGaussian | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth, | |||
int | filterSize | |||
) | [inline] |
Uses a Gaussian filter of size filterSize.
Referenced by GaussianPyrBuilder< T >::build(), buildPyrGabor(), SimulationViewerStd::doEventRetinaImage(), DisparityChannel::doInput(), RawVisualCortex::doInput(), StereoChannel::doInput(), DepthChannel::doInput(), ContourChannel::doInput(), RetinaAdapter::getOutput(), main(), maxNormalizeFancyFast(), SingleChannel::setClipPyramid(), BeobotVisualCortex::singleCPUprocess(), BeobotBrainMT::threadCompute(), and FOEestimator::updateFOE().
ImageSet<T_or_RGB> buildPyrGeneric | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth, | |||
const PyramidType | typ, | |||
const float | gabor_theta = 0.0f , |
|||
const float | gabor_intens = 10.0f | |||
) | [inline] |
Build a pyramid of type given by the PyramidType.
Referenced by ReichardtPyrBuilder< T >::build(), GenericPyrBuilder< T >::build(), RegSaliency::calcIntensity(), SaliencyMT::computeCMAP(), BeoSubSaliency::computeCMAP(), computeCMAP(), and RegSaliency::postChannel().
ImageSet<T_or_RGB> buildPyrLaplacian | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth, | |||
int | filterSize | |||
) | [inline] |
Uses a Laplacian filter of size filterSize.
Referenced by LaplacianPyrBuilder< T >::build(), buildPyrGabor(), OrientationChannel::doInput(), and ContourChannel::doInput().
ImageSet<T_or_RGB> buildPyrLocalAvg | ( | const Image< T_or_RGB > & | image, | |
int | depth | |||
) | [inline] |
Just fills the deepest level with the local image average at that scale.
ImageSet<T_or_RGB> buildPyrLocalAvg2x2 | ( | const Image< T_or_RGB > & | image, | |
int | depth | |||
) | [inline] |
Each level contains local 2x2 averages of the previous level.
Referenced by buildPyrRetinexLog().
ImageSet<T_or_RGB> buildPyrLocalMax | ( | const Image< T_or_RGB > & | image, | |
int | depth | |||
) | [inline] |
Just fills the deepest level with the local image maximum at that scale.
ImageSet<T_or_RGB> buildPyrOriented | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth, | |||
int | filterSize, | |||
float | theta, | |||
float | intens = 10.0f , |
|||
const bool | usetab = false | |||
) | [inline] |
Uses an oriented Laplacian filter with a given size/orientation/intensity.
This is a fast approximation to gabor convolution.
usetab | Whether to use trig tables to speed up the computations at the cost of some loss of precision. |
Referenced by OrientedPyrBuilder< T >::build(), BeobotVisualCortex::singleCPUprocess(), and BeobotBrainMT::threadCompute().
ImageSet<T_or_RGB> buildPyrOrientedFromLaplacian | ( | const ImageSet< T_or_RGB > & | laplacian, | |
int | filterSize, | |||
float | theta, | |||
float | intens = 10.0f , |
|||
const bool | usetab = false | |||
) | [inline] |
Uses an oriented Laplacian filter with a given size/orientation/intensity.
This is a fast approximation to gabor convolution.
usetab | Whether to use trig tables to speed up the computations at the cost of some loss of precision. |
ImageSet<T_or_RGB> buildRadialPyrGaussian | ( | const Image< T_or_RGB > & | image, | |
int | firstlevel, | |||
int | depth | |||
) | [inline] |
Uses a Gaussian filter of size 5 designed for radially transformed images.
Referenced by GaussianRadialPyrBuilder< T >::build(), and RawVisualCortex::doInput().
void centerSurround | ( | const ImageSet< T > & | pyr, | |
const int | lev1, | |||
const int | lev2, | |||
Image< T > & | pos, | |||
Image< T > & | neg, | |||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute center-surround between images, splitting positive and negative.
Definition at line 537 of file PyramidOps.C.
References ASSERT, centerSurround(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Image<T> centerSurround | ( | const ImageSet< T > & | pyr, | |
const int | lev1, | |||
const int | lev2, | |||
const bool | absol = false , |
|||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute center-surround between images at lev1 and lev2.
Definition at line 509 of file PyramidOps.C.
References ASSERT, centerSurround(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
void centerSurroundDiff | ( | const ImageSet< T > & | pyr1, | |
const ImageSet< T > & | pyr2, | |||
const int | lev1, | |||
const int | lev2, | |||
Image< T > & | pos, | |||
Image< T > & | neg, | |||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute center-surround differnces, splitting pos & neg values.
Definition at line 662 of file PyramidOps.C.
References ASSERT, centerSurround(), Image< T >::getDims(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Image<T> centerSurroundDiff | ( | const ImageSet< T > & | pyr1, | |
const ImageSet< T > & | pyr2, | |||
const int | lev1, | |||
const int | lev2, | |||
const bool | absol = false , |
|||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute center-surround between difference images at lev1 and lev2.
Difference images are obtained at each level by taking the difference between the image from *this minus the image from other_pyr
Definition at line 627 of file PyramidOps.C.
References ASSERT, centerSurround(), Image< T >::getDims(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Referenced by SingleChannel::centerSurround().
void centerSurroundDiffSingleOpponent | ( | const ImageSet< T > & | cpyr1, | |
const ImageSet< T > & | cpyr2, | |||
const ImageSet< T > & | spyr1, | |||
const ImageSet< T > & | spyr2, | |||
const int | lev1, | |||
const int | lev2, | |||
Image< T > & | pos, | |||
Image< T > & | neg, | |||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute single-opp center-surround differnces, splitting pos & neg values.
Definition at line 736 of file PyramidOps.C.
References ASSERT, centerSurround(), Image< T >::getDims(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Image<T> centerSurroundDiffSingleOpponent | ( | const ImageSet< T > & | cpyr1, | |
const ImageSet< T > & | cpyr2, | |||
const ImageSet< T > & | spyr1, | |||
const ImageSet< T > & | spyr2, | |||
const int | lev1, | |||
const int | lev2, | |||
const bool | absol = false , |
|||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute single-opp center-surround btw difference images at lev1 and lev2.
Difference images are obtained at each level by taking the difference between the image from *this minus the image from other_pyr
Definition at line 697 of file PyramidOps.C.
References ASSERT, centerSurround(), Image< T >::getDims(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Referenced by SingleOpponentChannel::centerSurround().
void centerSurroundSingleOpponent | ( | const ImageSet< T > & | cpyr, | |
const ImageSet< T > & | spyr, | |||
const int | lev1, | |||
const int | lev2, | |||
Image< T > & | pos, | |||
Image< T > & | neg, | |||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute single-opp center-surr between imgs, splitting pos and neg.
Definition at line 596 of file PyramidOps.C.
References ASSERT, centerSurround(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Image<T> centerSurroundSingleOpponent | ( | const ImageSet< T > & | cpyr, | |
const ImageSet< T > & | spyr, | |||
const int | lev1, | |||
const int | lev2, | |||
const bool | absol = false , |
|||
const ImageSet< float > * | clipPyr = 0 | |||
) | [inline] |
Compute single-opponent center-surround between images at lev1 and lev2.
This is essentially cpyr[lev1] - spyr[lev2]
Definition at line 564 of file PyramidOps.C.
References ASSERT, centerSurround(), ImageSet< T >::isNonEmpty(), max(), min(), and ImageSet< T >::size().
Referenced by SingleOpponentChannel::centerSurround().
Image<T_or_RGB> foveate | ( | const Image< byte > & | mask, | |
const ImageSet< T_or_RGB > & | pyr | |||
) | [inline] |
Generate a foveation blur.
Mask should be 255 inside the object and 0 outside; the pyramid should be a Gaussian pyramid and will be used to create the eccentricity-dependent blur. The deeper the pyramid, the more severe the blur
Referenced by RetinaAdapter::getOutput(), and SimulationViewerStd::getTraj().
T_or_RGB getPyrPixel | ( | const ImageSet< T_or_RGB > & | pyr, | |
const float | x, | |||
const float | y, | |||
const float | z | |||
) | [inline] |
Get value of a pixel from a dyadic pyramid with trilinear interpolation.
T_or_RGB getPyrPixel | ( | const ImageSet< T_or_RGB > & | pyr, | |
const Point2D< int > & | p, | |||
const uint | lev | |||
) | [inline] |
Get value of a pixel from a dyadic pyramid at a given level and coordinates.
pix | The pixel value returned | |
p | Coordinates given at scale 0 (base pyramid level); bilinear interpolation will be used to compute pixel value at given level. | |
lev | The pyramid level to get the pixel value from. |
T_or_RGB getPyrPixelNI | ( | const ImageSet< T_or_RGB > & | pyr, | |
const Point2D< int > & | p, | |||
const uint | lev | |||
) | [inline] |
Get value of a pixel from a dyadic pyramid at a given level and coordinates, no interpolation.
pix | The pixel value returned | |
p | Coordinates given at scale 0 (base pyramid level); This version does not use interpolation. | |
lev | The pyramid level to get the pixel value from. |
Referenced by JetFiller::visitSingleChannel().
Image<T_or_RGB> weightedBlur | ( | const Image< byte > & | modulator, | |
const ImageSet< T_or_RGB > & | pyr | |||
) | [inline] |
generate a weighted blur
The higher the modulator value (0..255), the more blurring at that location
Referenced by SimulationViewerCompress::getTraj().