Package

toolkit.filtering

spatial

Permalink

package spatial

Visibility
  1. Public
  2. All

Type Members

  1. class LinearBasis extends AnyRef

    Permalink

    Basis filters and their duals for a local, weighted, linear expansion locally at each point in a 2D scalar field.

    Basis filters and their duals for a local, weighted, linear expansion locally at each point in a 2D scalar field.

    See "Spatial domain methods for orientation and velocity estimation" by Gunnar Farneback, chapter 3, for a detailed description.

  2. class QuadraticBasis extends AnyRef

    Permalink

    Basis filters and their duals for a local, weighted, quadratic expansion locally at each point in a 2D scalar field.

    Basis filters and their duals for a local, weighted, quadratic expansion locally at each point in a 2D scalar field.

    See "Spatial domain methods for orientation and velocity estimation" by Gunnar Farneback, chapter 3, for a detailed description.

  3. class SphericalPoissonFilters extends AnyRef

    Permalink

    Implements the spherical Poisson filter as described in "Optical Flow Estimation from Monogenic Phase" by M.

    Implements the spherical Poisson filter as described in "Optical Flow Estimation from Monogenic Phase" by M. Felsberg, section 3.4. Although most naturally expressed using quaternions, we simply use scalars.

  4. class PolynomialFilters extends AnyRef

    Permalink

    Implements a weighted, polynomial expansion locally at each point in a 2D scalar field.

    Implements a weighted, polynomial expansion locally at each point in a 2D scalar field. The weighting, specified by the "applicability" matrix, would typically be Gaussian for many applications, but that is not required. The basis set consists of the matrices (1, x, y, x2, x * y, y2). To use, simply convolve each of the generated kernels over the field. Each convolution will produce the coefficent for the corresponding basis element.

    The outputs are the six kernels: "dcKernel", "xKernel", "yKernel", "xxKernel", "xyKernel" and "yyKernel"

    See "Spatial domain methods for orientation and velocity estimation" by Gunnar Farneback, chapter 3, for a detailed description.

    Annotations
    @deprecated
    Deprecated

    Use QuadraticBasis instead

Value Members

  1. object ApplicabilityFilter

    Permalink

    Implements the "applicability" filter as described in "Normalized and differential convolution: methods for interpolation and filtering of incomplete and uncertain data," Knutsson and Westin.

  2. object BilinearFilter

    Permalink

    Bilinear filter.

  3. object BlackmanWindow

    Permalink

    Implements a Blackman window.

    Implements a Blackman window.

    See http://en.wikipedia.org/wiki/Window_function#Blackman_windows

  4. object BorderMask

    Permalink

    Creates a mask for an image with 1's in the center of the "valid" region (for convolution or cross correlation) and 0's around the border.

  5. object BoxFilter

    Permalink

    Factory for creating 2D box filters.

  6. object CenterSurroundFilter

    Permalink

    An on-center, off-surround filter, implemented as a narrow center Gaussian minus a broad surround Gaussian.

    An on-center, off-surround filter, implemented as a narrow center Gaussian minus a broad surround Gaussian. Each Gaussian is normalized to sum to 1.

  7. object ComplexPolarFilter

    Permalink

    Factory for creating complex filters (ComplexScalarFields) from a function that generates a complex number at a point given the polar coordinates of that point (r, theta).

  8. object DOGFilter

    Permalink

    Center surround filter implemented as a difference of Gaussians.

    Center surround filter implemented as a difference of Gaussians. The total volume under the filter is normalized to zero.

  9. object GaborBasisFilters

    Permalink

    A basis of 9 x 9 Gabor filters from the paper "The design and use of steerable filters," Freeman and Adelson, 1991.

    A basis of 9 x 9 Gabor filters from the paper "The design and use of steerable filters," Freeman and Adelson, 1991.

    These use the separable G2 and H2 filters, 7 different filters total.

  10. object GaussianDerivativeFilter

    Permalink

    Utilities for computing 1-D Gaussians.

  11. object GaussianFilter

    Permalink

    Constructor for a simple symmetric Gaussian filter.

  12. object LanczosFilter

    Permalink

    The LanczosFilter is used for resampling discrete images, especially upsampling, to interpolate missing values.

    The LanczosFilter is used for resampling discrete images, especially upsampling, to interpolate missing values. This implementation is used mainly for 2X upsampling, meaning that an M x N image is interpolated to a 2M x 2N image. To use this kernel, convert the M x N image to 2M x 2N by inserting zeroes in the unsampled points, then convolving that with this kernel. Higher upsampling is also possible (below).

    The filter has a parameter, a, which implicitly defines the size of the filter. In practice, only two values of a are used:

    a kernel size ------------------ 2 7 x 7 3 11 x 11

    The default value for a is 2 since it is the "best compromise in terms of reduction of aliasing, sharpness, and minimal ringing." See http://en.wikipedia.org/wiki/Lanczos_resampling for a discussion of this.

    The second parameter, upsampleFactor, defines how much interpolation is to be done. The default value is 2. For a larger value, say K, convert the M x N image to a KM x KN image by inserting zeros and convolving with this kernel.

  13. object LaplacianFilter

    Permalink

  14. object LinearExpansion extends FloatMath

    Permalink

    Does a local polynomial expansion of a 2D image assuming constant certainty and a Gaussian applicability.

    Does a local polynomial expansion of a 2D image assuming constant certainty and a Gaussian applicability. See "Polynomial expansion for orientation and motion estimation," Farneback, section 4.8, equations 4.30

  15. object MexicanHatFilter

    Permalink

    Laplacian of a Gaussian.

    Laplacian of a Gaussian. See "Vision" by David Marr, section 2.2. Note that this kernel autosizes based on the value of sigma that is supplied (crudely done, but good enough).

  16. object NormalizedConvolution

    Permalink

    Function which performs normalized averaging (often referred to as normalized convolution) of a field.

    Function which performs normalized averaging (often referred to as normalized convolution) of a field.

    The result is similar to linear diffusion with Dirichlet boundary constraints (where the boundary is formed by the "certain" pixels in the field) but is much faster. This may not be what you want since it produces very fuzzy filled-in regions for large blocks of uncertain values.

    Typical usage:

    val image: Field  // image with missing pixels
    val applicability = ApplicabilityFilter(width = 33, alpha = 3, beta = 0)
    val certainty = ScalarField(...) // 1 => pixel certain, 0 => pixel unknown
    val filteredImage = NormalizedConvolution(image, applicability, certainty)
  17. object QuadraticExpansion extends FloatMath

    Permalink

    Does a local polynomial expansion of a 2D image assuming constant certainty and a Gaussian applicability.

    Does a local polynomial expansion of a 2D image assuming constant certainty and a Gaussian applicability. See "Polynomial expansion for orientation and motion estimation," Farneback, section 4.8, equations 4.30

  18. object ScharrFilter

    Permalink

    Factory for creating Scharr filters, useful for creating tiny gradient operators.

  19. object SimpleCellFilter

    Permalink

    A simple cell filter, using a simple cell model frequently found in the works of Steve Grossberg.

  20. object SimpleCellFilterBank

    Permalink

    A bank of simple cell filters with equal angular spread.

  21. object SteerableGaborFilters

    Permalink

    Steerable filters as described in the paper "The Design and Use of Steerable Filters," Freeman and Adelson, IEEE Trans.

    Steerable filters as described in the paper "The Design and Use of Steerable Filters," Freeman and Adelson, IEEE Trans. Patt. Anal. and Machine Intell., vol 13, no. 9, pp 891-901, Sept. 1991.

    The filters follow the naming convention of the paper to make it easy to cross reference the paper and implementation.

    I have chosen the *SEPARABLE* kernels for the basis kernels, so these can all be implemented more efficiently than with the FFT.

  22. object StickFilter

    Permalink

    A Stick filter is a 2-dimensional Gaussian with different sigmas for each dimension.

    A Stick filter is a 2-dimensional Gaussian with different sigmas for each dimension. The constructor also allows the stick to be offset radially from the center, in the direction perpendicular to the "long" direction of the kernel, and to be rotated. The size of the kernel is computed automatically.

  23. object StickFilterExample

    Permalink

    An example of Stick filters with equal angular spread.

  24. object TukeyWindow

    Permalink

    Implements a Tukey window.

    Implements a Tukey window.

    See http://en.wikipedia.org/wiki/Window_function

Ungrouped