All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.jhlabs.image.Kernel

java.lang.Object
   |
   +----com.jhlabs.image.Kernel

public class Kernel
extends java.lang.Object
A convolution kernel.


Variable Index

 o cols
 o EDGE_LAPLACE1
 o EDGE_LAPLACE2
 o FREI_CHEN_H
 o FREI_CHEN_V
 o matrix
 o PREWITT_H
 o PREWITT_V
 o R2
 o ROBERTS_H
 o ROBERTS_V
 o rows
 o SOBEL_H
 o SOBEL_V
 o xCentre
 o yCentre

Constructor Index

 o Kernel()
Construct a null kernel.
 o Kernel(double[])
Construct a kernel with the given 3x3 matrix.
 o Kernel(int, int, double[])
Construct a kernel with the given matrix.
 o Kernel(int, int, int, int, double[])
Construct a kernel with the given matrix.

Method Index

 o getMatrix()
 o normalize()
Normalize a convolution kernel.
 o setMatrix(double[])
Set the (3x3) convolution kernel.
 o setMatrix(int, int, double[])
Set the convolution kernel.
 o setMatrix(int, int, int, int, double[])
Set the convolution kernel.

Variables

 o R2
 public static final double R2
 o ROBERTS_V
 public static final double ROBERTS_V[]
 o ROBERTS_H
 public static final double ROBERTS_H[]
 o PREWITT_V
 public static final double PREWITT_V[]
 o PREWITT_H
 public static final double PREWITT_H[]
 o SOBEL_V
 public static final double SOBEL_V[]
 o SOBEL_H
 public static double SOBEL_H[]
 o FREI_CHEN_V
 public static final double FREI_CHEN_V[]
 o FREI_CHEN_H
 public static double FREI_CHEN_H[]
 o EDGE_LAPLACE1
 public static double EDGE_LAPLACE1[]
 o EDGE_LAPLACE2
 public static double EDGE_LAPLACE2[]
 o matrix
 public double matrix[]
 o rows
 public int rows
 o cols
 public int cols
 o xCentre
 public int xCentre
 o yCentre
 public int yCentre

Constructors

 o Kernel
 public Kernel()
Construct a null kernel. This is only useful if you're going to change the kernel later on.

 o Kernel
 public Kernel(double matrix[])
Construct a kernel with the given 3x3 matrix.

Parameters:
matrix - an array of 9 doubles containing the kernel
 o Kernel
 public Kernel(int rows,
               int cols,
               double matrix[])
Construct a kernel with the given matrix.

Parameters:
rows - the number of rows in the kernel
cols - the number of columns in the kernel
matrix - an array of rows*cols doubles containing the kernel
 o Kernel
 public Kernel(int rows,
               int cols,
               int xCentre,
               int yCentre,
               double matrix[])
Construct a kernel with the given matrix.

Parameters:
rows - the number of rows in the kernel
cols - the number of columns in the kernel
xCentre - the centre of the kernel in the x direction
yCentre - the centre of the kernel in the y direction
matrix - an array of rows*cols doubles containing the kernel

Methods

 o setMatrix
 public void setMatrix(double matrix[])
Set the (3x3) convolution kernel.

Parameters:
matrix - an array of 9 doubles containing the kernel
 o setMatrix
 public void setMatrix(int rows,
                       int cols,
                       double matrix[])
Set the convolution kernel.

Parameters:
rows - the number of rows in the kernel
cols - the number of columns in the kernel
matrix - an array of rows*cols doubles containing the kernel
 o setMatrix
 public void setMatrix(int rows,
                       int cols,
                       int xCentre,
                       int yCentre,
                       double matrix[])
Set the convolution kernel.

Parameters:
rows - the number of rows in the kernel
cols - the number of columns in the kernel
xCentre - the centre of the kernel in the x direction
yCentre - the centre of the kernel in the y direction
matrix - an array of rows*cols doubles containing the kernel
 o getMatrix
 public double[] getMatrix()
 o normalize
 public void normalize()
Normalize a convolution kernel. You can call this to normalize a kernel you've created by hand.

Parameters:
matrix - the kernel

All Packages  Class Hierarchy  This Package  Previous  Next  Index