The LUCS KDD random image generator is intended for use with image mining software. It produces a sequence of images all measuring 120x80 pixels of the form shown in Figure 1.
Figure 1: Example Random Images.
2. DOWNLOADING THE SOFTWARE
The system comprises the following java source files (In alphabetic order):
|File Name||Brief description|
|Foreground.java||Defines the foreground of an image which may be "sea", "land", "land and sea" or "sea and land".|
|hill.java||Defines a hill image feature comprised of a left (SW) and a right (SE) triangle back to back. Hill features are located along the horizon image component.|
|House.java||Defines a house image feature, with up to three windows/doors, made up of rectangular and triangular image objects. Hourse image features can only be located within "land" foregrounds. Four version of the feature are defined according to whether they are distant, middle distant, middle close or close to the viewer. Location is center-base of house.|
|House2.java||Defines a house image feature, with up to two windows/doors, made up of rectangular and triangular image objects. Hourse image features can only be located within "land" foregrounds. Four version of the feature are defined according to whether they are distant, middle distant, middle close or close to the viewer. Location is center-base of house.|
|House3.java||Defines a house image feature, with one window/door, made up of rectangular and triangular image objects. Hourse image features can only be located within "land" foregrounds. Four version of the feature are defined according to whether they are distant, middle distant, middle close or close to the viewer. Location is center-base of house.|
|Image.java||Defines a single random image comprising sky, horizon and foreground components and zero or more image features.|
|ImageBaseCanvas.java||Creates a "paint" canvas in which to display the image base once generated.|
|ImageBaseWindow.java||Creates a window in which a "paint" canvas is displayed which in turn is used to depict the image base once it is generated.|
|ImageFeature.java||Generic parent class for image features. Examples of image features include: house, tree and boat.|
|ImageObject.java||Generic parent class for image objects. Currently only two kinds of image object are defined: rectangles and triangles.|
|ImageUtilities.java||Set of utility methods to support the random image generation process.|
|LandAndSeaFG.java||Foreground component comprising sea and land, land first and sea towards the horizon.|
|LandFG.java||Foreground component comprising land only.|
|NEtriangle.java||Right angled triangle with right angle at NE corner.|
|NWtriangle.java||Right angled triangle with right angle at NW corner.|
|RandomImageGen.java||The model for the random image generator.|
|RandomImageGenApp.java||The application class for the random image generator.|
|RandomImageGenControl.java||Control (GUI) class for random image generator.|
|Rectangle.java||Rectangular image object.|
|SailBoat.java||Defines a sail boat image feature comprised of rectangular and triangular image objects. SailBoat image features can only be located within "sea" foregrounds. Three version of the feature are defined according to whether they are distant, middle distant or close to the viewer. Location is the bottom middle of the hull.|
|SeaAndLandFG.java||Foreground component comprising land and sea, sea first and land towards the horizon.|
|Sea.java||Foreground component comprising sea only.|
|SEtriangle.java||Right angled triangle with right angle at SE corner.|
|SingleImageCanvas.java||Creates a "paint" canvas in which to display a single generated image.|
|SingleImageWindow||Creates a window in which a "paint" canvas is displayed which in turn is used to depict a single image selected from the image base.|
|Sky.java||Defines the image sky component and where the sky image component meets the foreground image component.|
|SteamBoat1||Defines a steam boat image feature comprised of rectangular and triangular image objects. SailBoat image features can only be located within "sea" foregrounds. Three version of the feature are defined according to whether they are distant, middle distant or close to the viewer. Location is the bottom middle of the hull.|
|SWtriangle.java||Right angled triangle with right angle at SW corner.|
|Tree.java||Defines a tree comprised of a nuumber of rectangular shapes, one for the trunk and several more for the foliage. Location is base of tree trunk.|
|TriangleIO.java||Defines a triangle image object|
To download the source files a "tarball" is available. Alternatively users can go to here and copy files in the usual manner.
The software has been implemented in Java using the Java2 SDK (Software Development Kit) Version 1.4.0, which should therefore make it highly portable. The code does not require any special packages and thus can be compiled using the standard Java compiler:
The software can be run in the usual manner:
A GUI (Figure 2)will appear which is straightforward to use.
Figure 2: Random Image Generator Interface.
The code can be documented using Java Doc. First create a directory Documentation in which to place the resulting HTML pages and then type:
javadoc -d Documentation/ *.java
This will produce a hierarchy of WWW pages contained in the Document directory.
3. THE IMAGE GENERATOR IN MORE DETAIL
The gebnerated random images comprise various predefined landscape features and are stored as a sequence of .bmp files. At a high level an image is structured as shown in Figure 2.
IMAGE ::= SKY, FOREGROUND SKY ::= height, colour=white|blue|light gray, SKY_IMAGE_FEATURES FOREGROUND ::= SEA | LAND | SEA_AND_LAND) | LAND_AND_SEA SEA ::= colour=blue, SEA_IMAGE_FEATURES LAND ::= colour=lightGreen, LAND_IMAGE_FEATURES
Figure 2: Structure of image ("::=" should be read as "comprises", "," an "and", "|" an "or")
From Figure 2 it can be observed that an image comprises sky and foreground. The sky part of the image can contain a number of "sky image features". Currently the only sky features available are hills which "sit" on the horizon, an image may include between 0 and 3 hills. Hills come in three sizes: small. medium and large; and two colours: "light brown" and "lilac". Current possible sky colours "are light blue", "white", "light gray".
The foreground part of the image may comprise either: "land", "sea", "land and sea" or "sea and land" with the distinction between the last two being that the first named is the closest to the viewer. Sea is always "blue" and land "light green". The foreground may also contain between 0 and 5 foreground image features. Currently there are two land image features available (trees and houses) and one sea feature (sailing boats).
4. IMAGE FEATURES AND OBJECTS
Image features are all sub classes of the class ImageFeature. Image features are built up from a number of primitives called image objects. Five kinds of image object are available:
each represented by its own class. The NE, SE, SW and NW references refer to the orientation of the triangle, a NE triangle has the right angled corner to the NE etc. The triangle objects are all sub-classes of the class TriangleIO. The TriangleIO class in turn, and the rectangle class, are then sub-classes of the class ImageObject (See Figure 2).
ImageObject | +--------------+---------------+ | | TriangleIO Rectangle | +----------+-----+-----+-----------+ | | | | NEtriangle SEtriangle SWtrainagle NWtraiangle
Fig 2: Image Object (IO) class structure
The available colours (currently there are 24 of these) are listed in the ImageUtilities.java file together with the features which they are used for. When creating a new image feature make sure to update the comments in ImageUtilities.java file listing what each colour is used for what.
To add a new colour to the ImageUtilities.java file:
6. ADDING A NEW IMAGE FEATURE
To add a new feature follow the following steps.
Now you will able to generate new images that include your feature!