cbr.util
Class BlurFilter

java.lang.Object
  extended bycbr.util.BlurFilter

public class BlurFilter
extends Object

This class implements a simple convolution filter with a kernal consisting entirely of ones. The border lines and columns are not blurred. The kernal is a square of size three.

Version:
"$Id: BlurFilter.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Constructor Summary
private BlurFilter()
          No-one may instantiate this class.
 
Method Summary
static int[] getBlurredPixels(Image im)
          This method blurs the given image based on a simple convolution filter with a 3x3 kernal.
static int[] getBlurredPixels(int[] px, int width, int height)
          This method blurs the given pixels based on a simple convolution filter with a 3x3 kernal consisting only of ones.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlurFilter

private BlurFilter()
No-one may instantiate this class.

Method Detail

getBlurredPixels

public static int[] getBlurredPixels(Image im)
                              throws ImageException,
                                     InterruptedException
This method blurs the given image based on a simple convolution filter with a 3x3 kernal. The weights of the kernal are all ones. The return value is an array of integers that hold the RGB888 pixel values. The image must have a RGB888 color model and the samples must be packed into a single int per pixel. The image must also be loaded already. If the image data is not loaded already then use the Images class to load it and wait for completion.

Parameters:
im - The image to blur.
Returns:
The RGB888 pixel array of the blurred image.
Throws:
ImageException - if something is wrong with the image.
InterruptedException - if an interrupt occurs while loading the image data (unlikely).

getBlurredPixels

public static int[] getBlurredPixels(int[] px,
                                     int width,
                                     int height)
This method blurs the given pixels based on a simple convolution filter with a 3x3 kernal consisting only of ones. The resulting pixels are returned in a new array. The border pixels are not blurred.

Parameters:
px - The array of RGB pixel values.
width - The width of the image in pixels.
height - The height of the image in pixels.
Returns:
The blurred pixels.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.