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"
139template <
class DestImageIterator,
class DestAccessor>
149 double cosTheta= VIGRA_CSTD::cos(orientation);
150 double sinTheta= VIGRA_CSTD::sin(orientation);
162 int dcX= (w+1)/2,
dcY= (
h+1)/2;
170 for (
int x=0; x<w; x++,
dix++ )
196 for (
int x=0; x<w; x++,
dix++ )
203template <
class DestImageIterator,
class DestAccessor>
205createGaborFilter(triple<DestImageIterator, DestImageIterator, DestAccessor> dest,
206 double orientation,
double centerFrequency,
207 double angularSigma,
double radialSigma)
210 orientation, centerFrequency,
211 angularSigma, radialSigma);
214template <
class T,
class S>
217 double orientation,
double centerFrequency,
218 double angularSigma,
double radialSigma)
221 orientation, centerFrequency,
222 angularSigma, radialSigma);
247 double sfactor = 3.0 * VIGRA_CSTD::sqrt(VIGRA_CSTD::log(4.0));
291 * VIGRA_CSTD::sqrt(8.0 / (9 * VIGRA_CSTD::log(4.0)));
319template <
class ImageType,
320 class Alloc =
typename std::allocator_traits<typename ImageType::allocator_type>::template rebind_alloc<ImageType> >
325 int scaleCount_, directionCount_;
326 double maxCenterFrequency_;
331 for(
int direction= 0; direction<directionCount_; direction++)
332 for(
int scale= 0; scale<scaleCount_; scale++)
336 maxCenterFrequency_ / VIGRA_CSTD::pow(2.0, (
double)scale);
345 enum { stdFilterSize= 128, stdDirectionCount= 6, stdScaleCount= 4 };
376 Size2D(width, height > 0 ? height : width),
alloc),
405 return this->images_[
filterIndex(direction, scale)];
412 ParentClass::resizeImages(
newSize);
419 {
return scaleCount_; }
424 {
return directionCount_; }
443 {
return maxCenterFrequency_; }
Two dimensional difference vector.
Definition diff2d.hxx:186
Family of gabor filters of different scale and direction.
Definition gaborfilter.hxx:323
int scaleCount() const
Definition gaborfilter.hxx:418
void setMaxCenterFrequency(double maxCenterFrequency)
Definition gaborfilter.hxx:448
double maxCenterFrequency()
Definition gaborfilter.hxx:442
GaborFilterFamily(const Diff2D &size, int directionCount=stdDirectionCount, int scaleCount=stdScaleCount, double maxCenterFrequency=3.0/8.0, Alloc const &alloc=Alloc())
Definition gaborfilter.hxx:355
virtual void resizeImages(const Diff2D &newSize)
Definition gaborfilter.hxx:410
ImageType const & getFilter(int direction, int scale) const
Definition gaborfilter.hxx:403
int filterIndex(int direction, int scale) const
Definition gaborfilter.hxx:392
void setDirectionScaleCounts(int directionCount, int scaleCount)
Definition gaborfilter.hxx:429
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:371
int directionCount() const
Definition gaborfilter.hxx:423
Fundamental class template for arrays of equal-sized images.
Definition imagecontainer.hxx:74
size_type size() const
Definition imagecontainer.hxx:229
void resize(size_type newSize)
Definition imagecontainer.hxx:311
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:288
double radialGaborSigma(double centerFrequency)
Calculate sensible radial sigma for given parameters.
Definition gaborfilter.hxx:245