Core 1.0
GaborNoise Class Reference

Procedural noise using sparse Gabor convolution. More...

#include <gabornoise.h>

Inheritance diagram for GaborNoise:
AnalyticScalarField2

Public Member Functions

 GaborNoise (const double &, const double &, const double &, const double &, const double &, unsigned int)
 Create Gabor Noise.
double Value (const Vector2 &) const
 Compute the Gabor noise at a given point.
double Cell (int, int, const double &, const double &) const
 Compute the noise in a given cell.
double Variance () const
 Compute the variance of the noise.
Public Member Functions inherited from AnalyticScalarField2
 AnalyticScalarField2 (bool=true)
 Constructor.
virtual Vector2 Gradient (const Vector2 &) const
 Compute the gradient of the field.
virtual Matrix2 Hessian (const Vector2 &) const
 Compute the hessian at a given point.
virtual ScalarField2 Sample (const Array2 &) const
 Create a discrete scalar field by sampling a given domain.
bool Inside (const double &) const
 Check if the value is considered as inside or outside.
void Curvature (const Vector2 &, double &, double &) const
 Compute the gaussian and mean curvatures.
virtual Box2 GetBox () const
 Return the bounding box.

Protected Member Functions

double Gabor (const double &, const double &) const
 Compute the Gabor Kernel.
Protected Member Functions inherited from AnalyticScalarField2
Matrix Local (const Vector2 &) const
 Compute the local neighborhood in the one-ring aroung a point.

Protected Attributes

double K
 Amplitude.
double a
 Bandwidth of the Gaussian envelope.
double F0
 Frequency of the sinusoidal carrier.
double r
 Kernel radius.
double d
 Impulse density.
unsigned int o
 Random offset.
double s0
 Cosine and sine of the orientation of the sinusoidal carrier.
Protected Attributes inherited from AnalyticScalarField2
bool sign = true
 Sign convention, used for normal computation.
Box2 box = Box2::Infinity
 Domain, set as infinite for base class.

Additional Inherited Members

Static Protected Attributes inherited from AnalyticScalarField2
static const double epsilon = 1e-6
 \( \varepsilon \) value for first order partial derivatives (gradient).
static const double epsilonhessian = 1e-4
 Larger \( \varepsilon \) value for second order partial derivatives (hessian).

Detailed Description

Procedural noise using sparse Gabor convolution.

From A. Lagae, S. Lefebvre, G. Drettakis and P. Dutre. ACM Transactions on Graphics, 28(3), 2009.

Constructor & Destructor Documentation

◆ GaborNoise()

GaborNoise::GaborNoise ( const double & K,
const double & a,
const double & F_0,
const double & w0,
const double & n,
unsigned int offset )

Create Gabor Noise.

The Gabor kernel is the product of a Gaussian envelope and of a sinusoidal carrier: \( K e^{-\pi a^2 (x^2+y^2)} \cos(2 \pi F_0 (x \cos \omega_0 + y \sin \omega_0)) \).

Parameters
KAmplitude of the kernel.
aBandwidth of the Gaussian envelope: the larger a, the smaller the kernel, whose radius is about 0.98/a.
F_0Frequency of the sinusoidal carrier, in cycles per unit of length.
w0Orientation of the sinusoidal carrier, which is the angle \( \omega_0 \) in radians between its direction and the x axis. It is not a pulsation.
nMean number of impulses per kernel, i.e., per disc whose radius is the radius of the kernel.
offsetRandom offset.

Member Function Documentation

◆ Cell()

double GaborNoise::Cell ( int i,
int j,
const double & x,
const double & y ) const

Compute the noise in a given cell.

Parameters
i,jInteger coordinates of the cell.
x,yCoordinates of the point in the cell.

◆ Gabor()

double GaborNoise::Gabor ( const double & x,
const double & y ) const
protected

Compute the Gabor Kernel.

Parameters
x,yCoordinates of the point with respect to the center of the kernel, in units of length.

◆ Value()

double GaborNoise::Value ( const Vector2 & p) const
virtual

Compute the Gabor noise at a given point.

The plane is divided into square cells whose side is the radius of the kernel, and the noise is the sum of the contributions of the impulses of the cell of the point and of its eight neighbors.

Parameters
pPoint, in units of length, the scale of the noise being given by the bandwidth a and the frequency F_0.

Reimplemented from AnalyticScalarField2.

◆ Variance()

double GaborNoise::Variance ( ) const

Compute the variance of the noise.

The noise is a sparse convolution of impulses of density d, whose weights are uniform in [-1,1], i.e., of variance 1/3, with the Gabor kernel: the variance is the density times the variance of the weights times the integral of the square of the kernel.