JIGL
v1.6

jigl.image
Class ImageKernel

java.lang.Object
  |
  +--jigl.image.RealGrayImage
        |
        +--jigl.image.ImageKernel
All Implemented Interfaces:
Image

public class ImageKernel
extends RealGrayImage

ImageKernel is an extension of GrayImage with some pre-defined kernals.


Field Summary
static int D_XX
          D_xx Kernel.
static int D_XY
          D_xy Kernel.
static int D_YY
          D_yy Kernel.
static int LAPLACIAN
          Laplacian Kernel.
static int LAPLACIAN_8
          Laplacian 8 Kernel.
static int PREWITT_X
          Prewitt Kernel with X orientation.
static int PREWITT_Y
          Prewitt Kernel with Y orientation.
static int SOBEL_X
          Sorbel Kernel with X orientation.
static int SOBEL_Y
          Sobel Kernel with Y orientation.
static int UNIFORM
          Uniform Kernel.
static int UNSHARP
          Unsharpen Kernel.
static int UNSHARP_8
          Unsharpen 8 Kernel.
 
Fields inherited from class jigl.image.RealGrayImage
data, X, Y
 
Constructor Summary
ImageKernel(float[][] dat)
          Creates a kernel out of the given array.
ImageKernel(float val, int dimension)
          Creates a uniform kernel of specified size
ImageKernel(int val)
          Creates a kernel of one of the predefined types.
ImageKernel(RealGrayImage img)
          Creates an ImageKernel from a RealGrayImage
 
Method Summary
 void normalize()
          Normalize the kernel by total grayscales.
 void normalize255()
          "Normalizes" the ImageKernel by 255.
 
Methods inherited from class jigl.image.RealGrayImage
absSum, add, add, add, add, add, add, addbuffer, addbuffer, addSum, byteSize, byteSize, clear, clear, clip, clip, copy, copy, diff, divide, divide, divide, divide, divide, divide, get, getData, getJavaImage, max, max, median, median, min, min, multiply, multiply, multiply, multiply, multiply, multiply, set, set, sqrSum, subtract, subtract, subtract, subtract, subtract, subtract, toString, toString, X, Y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNIFORM

public static final int UNIFORM
Uniform Kernel.
111
111
111

See Also:
Constant Field Values

SOBEL_X

public static final int SOBEL_X
Sorbel Kernel with X orientation.
-101
-202
-101

See Also:
Constant Field Values

SOBEL_Y

public static final int SOBEL_Y
Sobel Kernel with Y orientation.
-1-2-1
000
121

See Also:
Constant Field Values

PREWITT_X

public static final int PREWITT_X
Prewitt Kernel with X orientation.
-101
-101
-101

See Also:
Constant Field Values

PREWITT_Y

public static final int PREWITT_Y
Prewitt Kernel with Y orientation.
-1-1-1
000
111

See Also:
Constant Field Values

LAPLACIAN

public static final int LAPLACIAN
Laplacian Kernel.
010
141
010

See Also:
Constant Field Values

LAPLACIAN_8

public static final int LAPLACIAN_8
Laplacian 8 Kernel.
111
1-81
111

See Also:
Constant Field Values

UNSHARP

public static final int UNSHARP
Unsharpen Kernel.
0-10
-15-1
0-10

See Also:
Constant Field Values

UNSHARP_8

public static final int UNSHARP_8
Unsharpen 8 Kernel.
-1-1-1
-19-1
-1-1-1

See Also:
Constant Field Values

D_XX

public static final int D_XX
D_xx Kernel.
1-21
1-21
1-21

See Also:
Constant Field Values

D_YY

public static final int D_YY
D_yy Kernel.
111
-2-2-2
111

See Also:
Constant Field Values

D_XY

public static final int D_XY
D_xy Kernel.
10-1
000
-101

See Also:
Constant Field Values
Constructor Detail

ImageKernel

public ImageKernel(int val)
            throws InvalidKernelException
Creates a kernel of one of the predefined types. val should be between 0 and 11.
         0 - UNIFORM		1 - SOBEL_X		2 - SOBEL_Y
         3 - PREWITT_X		4 - PREWITT_Y		5 - LAPLACIAN
         6 - LAPLACIAN_8		7 - UNSHARP		8 - UNSHARP_8
         9 - D_XX		10 - D_YY		11 - D_XY
         

Parameters:
val - kernel type
See Also:
UNIFORM, SOBEL_X, SOBEL_Y, PREWITT_X, PREWITT_Y, LAPLACIAN, LAPLACIAN_8, UNSHARP, UNSHARP_8, D_XX, D_YY, D_XY

ImageKernel

public ImageKernel(float val,
                   int dimension)
Creates a uniform kernel of specified size

Parameters:
val - uniform value for the kernel
dimension - size of kernel (dimension X dimension)

ImageKernel

public ImageKernel(float[][] dat)
Creates a kernel out of the given array. The kernel created will have dimensions equal to the number of elements in the first row.

Parameters:
dat - two-dimensional data array

ImageKernel

public ImageKernel(RealGrayImage img)
Creates an ImageKernel from a RealGrayImage

Method Detail

normalize255

public void normalize255()
"Normalizes" the ImageKernel by 255. However the result kernel is not totally normalized.


normalize

public void normalize()
Normalize the kernel by total grayscales.


JIGL
v1.6

Submit a bug or feature
Revised in May 2002 by Weiming Liu