Image Processing Bean Suite User's Guide

Table Of Contents

Copyright © 1998 IBM Corp. All rights reserved.

Java, JavaBeans and 100% Pure Java are trademarks of Sun Microsystems, Inc. All other trademarks are the property of their respective owners.

{short description of image}

TOC

Overview

Image Processing allows the user to manipulate the images to improve the pictorial information for human interpretation. The user can apply standard image processing techniques like Lowpass filtering, Highpass filtering, Edge detection, Histogram equalization, Zooming, Rotation, etc., to achieve a desired effect.

The Image Processing Suite of Beans provides a set of non-visual reusable Java beans which can be easily wired with other beans in various IDEs to create applications. The suite currently provides the following beans :

For detailed explanation on each bean refer to the Bean Usage section below.

The Image Processing Suite of Beans has been designed to be as light as possible and places minimal demands on the system resources.


TOC

System Requirements

Hardware Requirements

The Image Processing Suite of Beans is designed to be compliant with 100% Pure Java requirements and will therefore execute on any hardware platform that supports the Java Environment.

Approximately 170 KB of disk space are required to install the ImageProcessing.jar file.

Software Requirements

The Image Processing Suite of Beans is designed to work with Java Development Kit Version 1.1 and above.

Any Java application builder (e.g. VisualAge for Java from IBM Corp, VisualCafé from Symantec Corp., JBuilder from Inprise Corp.) that supports JavaBeans may be used to develop applications incorporating this bean.

In order to use the Image Processing Suite of Beans the user needs to have the uicontrols package installed on the user's machine. The uicontrols package may be obtained from the alphaBeans site. The user also has to set the uicontrols.jar file in the CLASSPATH.


TOC

Installation Instructions

  1. After downloading ImageProcessing.zip, unzip it. It will automatically create a new directory called ImageProcessing and extract files into it.
  2. To use the components in the BeanBox, copy (using relevant copy command in the operating system) the jar file for a required component (available in the lib directory) to the BeanBox's jars directory.
  3. To use the component in any of the IDEs, import a corresponding .jar file.

    {short description of image}Note: Please refer to the User's Guide of your IDE on how to import a bean into the IDE.
  4. To run the demo application provided with this package, follow the instructions in the readme.txt file in the demo directory.

TOC

Bean Usage

Common Bean Suite Information

There is lot of commonality among Image Processing Suite of Beans. This section describes the common properties, events, methods and wiring instructions for ImageProcessing Suite of beans. The properties, events and methods specific to a bean are described in the specific bean sections.

Properties

Following are the significant properties for all ImageProcessing Suite of beans:

Property Description Data Type Attributes* Default Value Valid Value
inputImage the original image to be processed. java.awt.Image W null an instance of Image(java.awt. Image)
result the processed image. java.awt.Image R, B null any instance of Image(java.awt. Image)
imageFilter filter extending from java.awt. image. ImageFilter to be used with the Filtered ImageSource class in JDK 1.1. java.awt.image. ImageFilter R, E an instance of a class extending from java.awt. image. ImageFilter an instance of a class extending from java.awt. image. ImageFilter
autoAction flag to indicate whether to do the processing whenever the input arguments or the control properties of the bean get changed. boolean R,W,B true true, false
debug. flag to indicate whether IllegalArgument Exception should be thrown if the input property is set to null. If the flag is true and the input property is set to null, IllegalArgument Exception is thrown else the null value is set as the input property. boolean R, W, B, E false true, false

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


Events

The ImageProcessing Suite of beans fire the following events:


Methods

The ImageProcessing Suite of beans implement the following significant methods:

ProcessingErrorEvent is fired if there is any error in processing an image.


Wiring Instructions

This section describes how any filter bean in this suite can be wired to other beans to build an image processing application. Refer to Figure 1 for the wiring diagram which is applicable to any of the filter beans.

Wiring Diagram
Figure 1 - ImageProcessing bean wiring diagram

This wiring diagram describes how a filter bean can be used with other beans to build an image processing application. This scenario requires a bean that can provide an input to the filter bean. The primary input is an image to be processed. It also expects a trigger (Event) to start the processing by calling the triggerAction method of the filter bean. Just before starting the processing, the filter bean throws the processingStarted event indicating that the image processing has started. Once the processing is over, the filter bean throws the processingOver event again, signifying the completion of the processing.

A concrete scenario is defined as follows:

The wiring diagram consists of a frame containing two image canvases and one button. Also one of the imageprocessing beans is dropped on the design surface. The left image canvas shows the original image and the right one shows the processed image.

Step-by-step wiring instructions are as follows:

  1. Customize properties for the left ImageCanvas to set the image.
  2. Customize the image processing bean's autoAction property to false.
  3. Wire the left ImageCanvas image property to the imageprocessing bean's inputImage property (conn1).
  4. Wire the image processing bean's result property to the second ImageCanvas bean's image property (conn2).
  5. Wire the button's actionPerformed event to the image processing bean's triggerAction() method (conn3).
    Note: In some of the IDEs like BeanBox property to property connection of image property of ImageCanvas to the inputImage property of the filter bean (conn1) and property to property connection of result property of filer bean to the image property of the ImageCanvas (conn2) is not possible as the type of the properties (com.ibm.uicontrols.ImageGlyph and java.awt.Image) are not compatible. In order to make this property to property connection, one more bean is required which will have two read-write-bound properties of types com.ibm.uicontrols.ImageGlyph (prop1) and java.awt.Image (prop2). This bean will act as a bridge in connecting two different types of properties in two beans. So in order to make a connection like conn1 in beanbox, a property to property connection can be made from the image property of the ImageCanvas to prop1 property of this bean and another property to property connection can be made from the prop2 property of this bean to the inputImage property of the filter bean. Similarly the connection like conn2 can be made using this bean.

EdgeDetectionFilter bean

Edge Detection is a type of image processing filter. An edge is the boundary between two regions with relatively distinct gray level properties. In some situations, the user needs to detect the outline of a digital image. The Edge Detection filter detects discontinuities in the gray level (intensity of a pixel) of the image thus producing the outline.

Refer to Figure 2 for an example of an image before and after Edge Detection.

edge detected image

Figure 2 - An image before and after Edge Detection

The EdgeDetectionFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The EdgeDetectionFilter bean can be used for detecting the edges or discontinuities in an image. This can be used for images where external representation or outline is significant as compared to the texture or inner details of an image. So, the EdgeDetectionFilter bean can be used in image processing applications for detection of edges in an image.


LowPassFilter bean

The most basic image manipulation involves the Lowpass filter. The Lowpass filtering is sometimes called blurring or smoothing. This averages out rapid changes of intensity from one pixel to the next one.

Refer to Figure 3 for an example of an image before and after the Lowpass filtering.

low pass filtered image

Figure 3 - An image after Low Pass Filtering

Noise in an image varies the values of adjacent pixels even though they were illuminated identically during an exposure. This may effect the image clarity. Suppressing noise helps to improve image clarity.

The LowPassFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. It is used for removing high frequency signals (such as noise in an image) and it has the effect of smoothing the original image.


TransparentFilter bean

Transparent images are those that produce a see-through effect so that the background image is visible.

Refer to Figure 4 for an example of a transparent image.

Transparent filtered image

Figure 4 - A Transparent image

The TransparentFilter bean can be used to create transparent images from existing images.

The TransparentFilter bean makes specified colors in the image to appear transparent by setting the transparency coefficients of those pixels to zero. The resultant image when superimposed with another image, the pixels with those colors will produce the see-through effect.


Properties

Following are the properties specific to the TransparentFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
colorList used to specify the transparent colors for the image. com.ibm. imageprocessing. ColorList R, W, B new com.ibm. imageProcessing. ColorList() new com.ibm. imageProcessing. ColorList()

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


Methods

The TransparentFilter bean implements the following significant methods:


BlackAndWhiteFilter bean

The BlackAndWhite filtering is the process of converting a colorful image to look like a black and white image.

Refer to Figure 5 for an example of an image before and after BlackAndWhiteFilter.

BlackAndWhite fltered image

Figure 5 - An image before and after BlackAndWhiteFilter

The BlackAndWhiteFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The BlackAndWhiteFilter bean can be used to get a black and white picture of a colored image. The red, green and blue components of a pixel are replaced by the average value of these components to give the Black and White effect.


ColorizationFilter bean

The Colorization filter is the process of retaining only a specified color in an image. All the other colors are removed from the image.

Refer to Figure 6 for an example of an image before and after ColorizationFilter. The red color is specified for colorization.

Colorized image

Figure 6 - An image before and after ColorizationFilter

The ColorizationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The ColorizationFilter bean gives an effect of looking at the image through glass of a particular color. The bean accepts a color as an input. To give this effect, the bits (rgb components) of a particular pixel are bitwise-anded with the bits of a particular color (chosen as the colorization color).


Properties

Following are the properties specific to the ColorizationFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
color used to specify the color for colorization java.awt.color R, W, B java.awt.Color.red any instance of java.awt.Color

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


DeColorizationFilter bean

The DeColorization filter is the process of removing a specified color from an image. All the other colors of the image are retained.

Refer to Figure 7 for an example of an image before and after DeColorizationFilter. The Blue color is decolorized.

Decolorized image

Figure 7 - An image before and after DeColorizationFilter

The DeColorizationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The bean accepts a color as an input. To give this effect, the bits (rgb components) of a particular pixel are bitwise-anded with the bits of the complement of a particular color (chosen as the decolorization color).


Properties

Following are the properties specific to the DeColorizationFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
color used to specify the color for decolorization java.awt.color R, W, B java.awt.Color.red any instance of java.awt.Color

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


MedianFilter bean

MedianFilter is similar to LowPassFilter. It reduces noise in an image without blurring edges and other sharp details.

Refer to Figure 8 for an example of an image before and after MedianFilter.

Median filtered image

Figure 8 - An image before and after MedianFilter

The MedianFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The median filter effect is achieved by replacing the gray level of each pixel by the median of the gray levels in a neighborhood of that pixel.


MirrorFilter bean

MirrorFilter gives the mirror reflection of an image.

Refer to Figure 9 for an example of an image before and after MirrorFilter.

Mirror filtered image

Figure 9 - An image before and after MirrorFilter

The MirrorFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. This filter can be used to show a reflected image either along the horizontal axis or vertical axis. The pixel positions are changed to give this effect.


Properties

Following are the properties specific to the MirrorFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
axis Used for setting the X-axis (horizontal) or Y-axis (vertical axis) along which the mirror effect is shown java.lang.String R,W,B “Y-axis” “Y-axis” , "X-axis"

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


Events

The events specific to MirrorFilter bean are:


NegativeFilter bean

NegativeFilter gives the negative of an image. Negatives of digital images are useful in numerous applications, such as displaying medical images (X-ray) etc.

Refer to Figure 10 for an example of an image before and after NegativeFilter.

Negative filtered image

Figure 10 - An image before and after NegativeFilter

The NegativeFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. It gives the same effect as the negative of a photograph. The gray level of each pixel is replaced by the complement of that gray level (i.e. the bits of red, green and blue components of a pixel are complemented).


RotationFilter bean

RotationFilter rotates an image in the steps of 90 degrees. So it can be used to rotate an image by 90, 180, 270 (or any non-negative angle which is a multiple of 90) degrees in the clockwise or anti-clockwise direction.

Refer to Figure 11 for an example of an image before and after RotationFilter.

Rotation filtered image

Figure 11 - An image before and after RotationFilter

The RotationFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The pixel positions are changed to give this effect. This can be used to display vertical text (as image) since Java does not provide an API for vertical text display.


Properties

Following are the properties specific to the RotationFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
direction Used for setting the direction of rotation java.lang.String R, W, B “Clockwise” “Clockwise” , "AntiClockwise"
rotationAngle used for setting the angle of rotation to 90, 180, 270 ( or a multiple of 90 or any non-negative angle which is a multiple of 90) degrees int R, W, B 90 any non-negative angle which is a multiple of 90

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


Events

The events specific to RotationFilter bean are:


ZoomFilter bean

This filter allows the user to scale an image by various zoom factors. Depending on the user's requirement this can enlarge or reduce the image size.

Refer to Figure 12 for an example of an image before and after ZoomFilter.

Zoom filtered image

Figure 12 - An image before and after ZoomFilter

The ZoomFilter bean is a non-visual reusable Java bean in the Image Processing Suite of Beans. The bean takes a zoom value as the input, which is specified in percentage. If the value is 100%, the result is the same as the original image. If the value is 50% the resultant image is reduced to half the size of the original image. The pixels in the source image are sampled to produce pixels for an image of a specified size by replicating rows and columns of pixels to scale up or omitting rows and columns of pixels to scale down.


Properties

Following are the properties specific to the ZoomFilter bean:

Property Description Data Type Attributes* Default Value Valid Value
zoomFactor Used for setting the zoom factor. A factor of 100 means the result will be the original image. 200 means the image size will be doubled. int R, W, B 100 integer greater than zero(>0)

* R = read, W = write, B = bound, E = expert

{short description of image} Note:
Control property - R, W, B
Input property - W
Output Property - R, B


Events

The specific events to ZoomFilter bean are:


TOC

Glossary of Terms

D | G | I |M | N | P 
D
Digital Image
A matrix whose row and column indices identify a point in an image and the corresponding matrix element value identifies the gray level at that point.
G
Gray Level
The brightness or intensity of a pixel in an image.
I
Image Filtering
The process of augmenting the desired density of image data in order to reduce other frequencies.
Image processing
Storage, processing, retrieval and display of digital image data for applications such as geology, robotics, etc.
M
Median
Middle value of the gray levels in the neighborhood of a pixel.
N
Noise
Elements in an image that distort the original content of the image.
P
Pixel
Picture element.