plugins.big.bigsnakeutils.process.process2D
Class Convolver2D

java.lang.Object
  extended by plugins.big.bigsnakeutils.process.process2D.Convolver2D

public class Convolver2D
extends java.lang.Object

Fast 2-D convolution routines for symmetric kernels. All methods require only the causal half of the kernel, i.e., elements [0..n], assuming a support of [-n..n]. Only kernels with odd support are implemented. Mirror border conditions are applied.

Version:
May 3, 2014
Author:
Francois Aguet

Constructor Summary
Convolver2D()
           
 
Method Summary
static double[][] convolveEvenX(double[][] input, double[] kernel)
          Convolution with a symmetric kernel along x.
static double[] convolveEvenX(double[] input, double[] kernel, int[] dims, int x1, int x2, int y1, int y2)
          Convolution with a symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2].
static double[] convolveEvenX(double[] input, double[] kernel, int nx, int ny)
          Convolution with a symmetric kernel along x, for an image defined as a 1-D array.
static float[] convolveEvenX(float[] input, float[] kernel, int nx, int ny)
          Convolution with a symmetric kernel along x, for an image defined as a 1-D array.
static double[][] convolveEvenY(double[][] input, double[] kernel)
          Convolution with a symmetric kernel along y.
static double[] convolveEvenY(double[] input, double[] kernel, int[] dims, int y1, int y2)
          Convolution with a symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2].
static double[] convolveEvenY(double[] input, double[] kernel, int nx, int ny)
          Convolution with a symmetric kernel along y, for an image defined as a 1-D array.
static float[] convolveEvenY(float[] input, float[] kernel, int nx, int ny)
          Convolution with a symmetric kernel along y, for an image defined as a 1-D array.
static double[][] convolveOddX(double[][] input, double[] kernel)
          Convolution with an anti-symmetric kernel along x.
static double[] convolveOddX(double[] input, double[] kernel, int[] dims, int x1, int x2, int y1, int y2)
          Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2].
static double[] convolveOddX(double[] input, double[] kernel, int nx, int ny)
          Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array.
static float[] convolveOddX(float[] input, float[] kernel, int nx, int ny)
          Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array.
static double[][] convolveOddY(double[][] input, double[] kernel)
          Convolution with an anti-symmetric kernel along y.
static double[] convolveOddY(double[] input, double[] kernel, int[] dims, int y1, int y2)
          Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2].
static double[] convolveOddY(double[] input, double[] kernel, int nx, int ny)
          Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array.
static float[] convolveOddY(float[] input, float[] kernel, int nx, int ny)
          Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array.
static double[][] movingSum(double[][] input, int length)
          Moving sum filter, applied to both dimensions.
static double[][] movingSumX(double[][] input, int length)
          Moving sum filter, applied to the x-dimension.
static double[][] movingSumY(double[][] input, int length)
          Moving sum filter, applied to the y-dimension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Convolver2D

public Convolver2D()
Method Detail

movingSum

public static double[][] movingSum(double[][] input,
                                   int length)
Moving sum filter, applied to both dimensions. Each dimension of the output is extended by 'length-1'.


movingSumX

public static double[][] movingSumX(double[][] input,
                                    int length)
Moving sum filter, applied to the x-dimension. The x-dimension of the output is extended by 'length-1'.


movingSumY

public static double[][] movingSumY(double[][] input,
                                    int length)
Moving sum filter, applied to the y-dimension. The y-dimension of the output is extended by 'length-1'.


convolveEvenX

public static double[][] convolveEvenX(double[][] input,
                                       double[] kernel)
Convolution with a symmetric kernel along x.


convolveEvenX

public static double[] convolveEvenX(double[] input,
                                     double[] kernel,
                                     int nx,
                                     int ny)
Convolution with a symmetric kernel along x, for an image defined as a 1-D array.


convolveEvenX

public static float[] convolveEvenX(float[] input,
                                    float[] kernel,
                                    int nx,
                                    int ny)
Convolution with a symmetric kernel along x, for an image defined as a 1-D array.


convolveEvenY

public static double[][] convolveEvenY(double[][] input,
                                       double[] kernel)
Convolution with a symmetric kernel along y.


convolveEvenY

public static double[] convolveEvenY(double[] input,
                                     double[] kernel,
                                     int nx,
                                     int ny)
Convolution with a symmetric kernel along y, for an image defined as a 1-D array.


convolveEvenY

public static float[] convolveEvenY(float[] input,
                                    float[] kernel,
                                    int nx,
                                    int ny)
Convolution with a symmetric kernel along y, for an image defined as a 1-D array.


convolveOddX

public static double[][] convolveOddX(double[][] input,
                                      double[] kernel)
Convolution with an anti-symmetric kernel along x.


convolveOddX

public static double[] convolveOddX(double[] input,
                                    double[] kernel,
                                    int nx,
                                    int ny)
Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array.


convolveOddX

public static float[] convolveOddX(float[] input,
                                   float[] kernel,
                                   int nx,
                                   int ny)
Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array.


convolveOddY

public static double[][] convolveOddY(double[][] input,
                                      double[] kernel)
Convolution with an anti-symmetric kernel along y.


convolveOddY

public static double[] convolveOddY(double[] input,
                                    double[] kernel,
                                    int nx,
                                    int ny)
Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array.


convolveOddY

public static float[] convolveOddY(float[] input,
                                   float[] kernel,
                                   int nx,
                                   int ny)
Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array.


convolveEvenX

public static double[] convolveEvenX(double[] input,
                                     double[] kernel,
                                     int[] dims,
                                     int x1,
                                     int x2,
                                     int y1,
                                     int y2)
Convolution with a symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2]. Usage: convolve{Even,Odd}X followed by convolve{Even,Odd}Y is mandatory.


convolveOddX

public static double[] convolveOddX(double[] input,
                                    double[] kernel,
                                    int[] dims,
                                    int x1,
                                    int x2,
                                    int y1,
                                    int y2)
Convolution with an anti-symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2]. Usage: convolve{Even,Odd}X followed by convolve{Even,Odd}Y is mandatory.


convolveEvenY

public static double[] convolveEvenY(double[] input,
                                     double[] kernel,
                                     int[] dims,
                                     int y1,
                                     int y2)
Convolution with a symmetric kernel along x, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2]. Usage: convolve{Even,Odd}X followed by convolve{Even,Odd}Y is mandatory.


convolveOddY

public static double[] convolveOddY(double[] input,
                                    double[] kernel,
                                    int[] dims,
                                    int y1,
                                    int y2)
Convolution with an anti-symmetric kernel along y, for an image defined as a 1-D array, in a region bounded by [x1..x2] and [y1..y2]. Usage: convolve{Even,Odd}X followed by convolve{Even,Odd}Y is mandatory.