knn
Class FilterBank

java.lang.Object
  |
  +--knn.FilterBank

public class FilterBank
extends java.lang.Object

This class implements a filterbank, i.e. a sort of super-convolver which with one method call computes multiple convolutions of an image with Gaussian derivative kernel at order, scale, and angle. Or, set it up as a FilterBank and compute a specific Copyright (c) 1999-2004, Michael Abramoff. All rights reserved.


Field Summary
protected  int n
           
protected  int nrOrders
           
protected  float[] scales
           
protected  float[][] thetas
           
 
Constructor Summary
FilterBank(float[] scales, int nrOrders)
           
 
Method Summary
static Feature[] filter(float[] image, int width, float[] scales)
          Convolve image with a filter bank with 0,1 and 2nd order oriented derivative of Gaussian filter (Gabor wavelets) at a number of scales and orientations.
 Feature filter(int filternumber, float[] image, int width, java.lang.String extraText)
          Apply the next filter to an image.
 int getNumber()
          Return the number of filters in this filter bank.
static Feature L(float[] image, int width, int n, double scale, double theta, java.lang.String extraText)
          Compute an L filter of order, scale and orientation.
static Feature[] L(float[] image, int width, int n, double scale, float[] theta)
          Compute a number of convolutions L of image (column vector) and width width, with a Gaussian order-th kernel at scale s and orientations theta.
protected static java.lang.String name(int order, double scale, double theta, java.lang.String extraText)
           
protected  double[] params(int filternumber)
          Determine the order, scale and orientation of a numbered filter.
static float[] scaleSet(int n)
          Return a set of n good scales for scale space.
static float[] thetaSet(int order)
          Return a set of good filter orientations (thetas) for filters of order.
 java.lang.String toString(int filternumber, java.lang.String preString)
          Return a descriptive String for this filter number.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scales

protected float[] scales

thetas

protected float[][] thetas

nrOrders

protected int nrOrders

n

protected int n
Constructor Detail

FilterBank

public FilterBank(float[] scales,
                  int nrOrders)
Method Detail

getNumber

public int getNumber()
Return the number of filters in this filter bank.

filter

public Feature filter(int filternumber,
                      float[] image,
                      int width,
                      java.lang.String extraText)
Apply the next filter to an image. The filter is determine by the currentFilter number which indicates which scale, order and orientation to use. filternumber is a consecutive number that identifies a filter with a specific scale, derivative order and orientation.

toString

public java.lang.String toString(int filternumber,
                                 java.lang.String preString)
Return a descriptive String for this filter number.

name

protected static java.lang.String name(int order,
                                       double scale,
                                       double theta,
                                       java.lang.String extraText)

params

protected double[] params(int filternumber)
Determine the order, scale and orientation of a numbered filter.
Returns:
a double[3] with the
 order
 scale
 theta in that order.

L

public static Feature L(float[] image,
                        int width,
                        int n,
                        double scale,
                        double theta,
                        java.lang.String extraText)
Compute an L filter of order, scale and orientation.
Parameters:
image - the image
width - the width of image in pixels.
n - the order of the derivatives
scale - the scale of the Gaussian used to compute the derivatives.
theta - the orientations of the derivatives.
Returns:
a float[][] with the resulting convolution.

filter

public static Feature[] filter(float[] image,
                               int width,
                               float[] scales)
Convolve image with a filter bank with 0,1 and 2nd order oriented derivative of Gaussian filter (Gabor wavelets) at a number of scales and orientations. Range of scales: 1,2,4,8 (see scaleSet). Range of orientations (depends on order). of orientations a number of convolutions Ln of image (column vector),
Parameters:
image - the image
width - the width of image in pixels.
scales - a float[] with the different scales at which to filter.
Returns:
a float[][] with the resulting convolutions.

thetaSet

public static float[] thetaSet(int order)
Return a set of good filter orientations (thetas) for filters of order. order 0 = 0 (trivial) order 1 = 0, 90 degrees order 2 = 0, 60, 120 degrees over 2 not defined.

scaleSet

public static float[] scaleSet(int n)
Return a set of n good scales for scale space. 1,2,4,8,16
Returns:
a float[] with increasing scales.

L

public static Feature[] L(float[] image,
                          int width,
                          int n,
                          double scale,
                          float[] theta)
Compute a number of convolutions L of image (column vector) and width width, with a Gaussian order-th kernel at scale s and orientations theta.
Parameters:
image - the image
width - the width of image in pixels.
n - the order of the derivatives
scale - the scale of the Gaussian used to compute the derivatives.
theta - a float[] with a number of orientations of the derivatives. Can be null, then n is also 0.
Returns:
a float[][] with the resulting convolutions.