37#ifndef VIGRA_GABORFILTER_HXX
38#define VIGRA_GABORFILTER_HXX
40#include "imagecontainer.hxx"
42#include "stdimage.hxx"
43#include "copyimage.hxx"
44#include "transformimage.hxx"
45#include "combineimages.hxx"
47#include "multi_shape.hxx"
138template <
class DestImageIterator,
class DestAccessor>
148 double cosTheta= VIGRA_CSTD::cos(orientation);
149 double sinTheta= VIGRA_CSTD::sin(orientation);
161 int dcX= (w+1)/2,
dcY= (
h+1)/2;
169 for (
int x=0; x<w; x++,
dix++ )
195 for (
int x=0; x<w; x++,
dix++ )
202template <
class DestImageIterator,
class DestAccessor>
204createGaborFilter(triple<DestImageIterator, DestImageIterator, DestAccessor> dest,
205 double orientation,
double centerFrequency,
206 double angularSigma,
double radialSigma)
209 orientation, centerFrequency,
210 angularSigma, radialSigma);
213template <
class T,
class S>
216 double orientation,
double centerFrequency,
217 double angularSigma,
double radialSigma)
220 orientation, centerFrequency,
221 angularSigma, radialSigma);
246 double sfactor = 3.0 * VIGRA_CSTD::sqrt(VIGRA_CSTD::log(4.0));
290 * VIGRA_CSTD::sqrt(8.0 / (9 * VIGRA_CSTD::log(4.0)));
318template <
class ImageType,
319 class Alloc =
typename ImageType::allocator_type::template rebind<ImageType>::other >
324 int scaleCount_, directionCount_;
325 double maxCenterFrequency_;
330 for(
int direction= 0; direction<directionCount_; direction++)
331 for(
int scale= 0; scale<scaleCount_; scale++)
335 maxCenterFrequency_ / VIGRA_CSTD::pow(2.0, (
double)scale);
344 enum { stdFilterSize= 128, stdDirectionCount= 6, stdScaleCount= 4 };
375 Size2D(width, height > 0 ? height : width),
alloc),
404 return this->images_[
filterIndex(direction, scale)];
411 ParentClass::resizeImages(
newSize);
418 {
return scaleCount_; }
423 {
return directionCount_; }
442 {
return maxCenterFrequency_; }
Two dimensional difference vector.
Definition diff2d.hxx:186
Family of gabor filters of different scale and direction.
Definition gaborfilter.hxx:322
int scaleCount() const
Definition gaborfilter.hxx:417
void setMaxCenterFrequency(double maxCenterFrequency)
Definition gaborfilter.hxx:447
double maxCenterFrequency()
Definition gaborfilter.hxx:441
GaborFilterFamily(const Diff2D &size, int directionCount=stdDirectionCount, int scaleCount=stdScaleCount, double maxCenterFrequency=3.0/8.0, Alloc const &alloc=Alloc())
Definition gaborfilter.hxx:354
virtual void resizeImages(const Diff2D &newSize)
Definition gaborfilter.hxx:409
ImageType const & getFilter(int direction, int scale) const
Definition gaborfilter.hxx:402
int filterIndex(int direction, int scale) const
Definition gaborfilter.hxx:391
void setDirectionScaleCounts(int directionCount, int scaleCount)
Definition gaborfilter.hxx:428
GaborFilterFamily(int width=stdFilterSize, int height=-1, int directionCount=stdDirectionCount, int scaleCount=stdScaleCount, double maxCenterFrequency=3.0/8.0, Alloc const &alloc=Alloc())
Definition gaborfilter.hxx:370
int directionCount() const
Definition gaborfilter.hxx:422
Fundamental class template for arrays of equal-sized images.
Definition imagecontainer.hxx:73
size_type size() const
Definition imagecontainer.hxx:228
void resize(size_type newSize)
Definition imagecontainer.hxx:310
Class for a single RGB value.
Definition rgbvalue.hxx:128
Two dimensional size object.
Definition diff2d.hxx:483
void createGaborFilter(...)
Create a gabor filter in frequency space.
double angularGaborSigma(int directionCount, double centerFrequency)
Calculate sensible angular sigma for given parameters.
Definition gaborfilter.hxx:287
double radialGaborSigma(double centerFrequency)
Calculate sensible radial sigma for given parameters.
Definition gaborfilter.hxx:244