|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.io.ImageInputTokenizer
public class ImageInputTokenizer
This tokenizer is responsible for collecting data from a list of Image file names or Image objects and feeding the data from the Images into a tokenized array of values for feeding into the Neural network. GIF, JPG and PNG image file formats can be read. The tokenizer operates in two modes, colour and grey scale.
Colour Mode In colour mode the tokenizer produces seperate RGB input values in the range 0 to 1 from the image. So using an image of width 10 and height 10 there will be 10x10x3 inputs in the range 0 to 1. The individual colour components are calculated by obtaining the RGB values from the image. These value are initially in an ARGB format. Transparency is removed and the RGB value extracted and normalised between 0 and 1.
Non Colour Mode / Grey Scale Mode In this mode the tokenizer treats each input value as a grey scale value for each pixel. In this mode only Width*Height values are required. To produce the final image the Red, Green and Blue components are the set to this same value. The grey scale component is calculated by obtaining the RGB values from the image. These value are initially in an ARGB format. Transparency is removed and the RGB value extracted, averaged and normalised to produce one grey scale value between 0 and 1.
Constructor Summary | |
---|---|
ImageInputTokenizer(int req_width,
int req_height,
java.awt.Image[] the_images,
boolean colour)
Creates new ImageInputTokenizer |
|
ImageInputTokenizer(int req_width,
int req_height,
java.util.Vector file_list,
boolean colour)
Creates new ImageInputTokenizer |
Method Summary | |
---|---|
char |
getDecimalPoint()
|
int |
getLineno()
Return the current line number. |
int |
getNumTokens()
Gets the number of tokens on the current line. |
double |
getTokenAt(int posiz)
Gets the token (RGB normalised between 0 and 1) at the specified position. |
double[] |
getTokensArray()
Insert the method's description here. |
void |
mark()
Mark the current position. |
boolean |
nextLine()
Fetchs the next line and extracts all the tokens |
void |
resetInput()
Go to the last marked position. |
void |
setDecimalPoint(char dp)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageInputTokenizer(int req_width, int req_height, java.util.Vector file_list, boolean colour) throws java.io.IOException
in
-
java.io.IOException
public ImageInputTokenizer(int req_width, int req_height, java.awt.Image[] the_images, boolean colour) throws java.io.IOException
in
-
java.io.IOException
Method Detail |
---|
public int getLineno()
getLineno
in interface PatternTokenizer
public int getNumTokens() throws java.io.IOException
getNumTokens
in interface PatternTokenizer
java.io.IOException
public double getTokenAt(int posiz) throws java.io.IOException
getTokenAt
in interface PatternTokenizer
posiz
- An int index into the current lines tokens.
java.io.IOException
public double[] getTokensArray()
getTokensArray
in interface PatternTokenizer
public void mark() throws java.io.IOException
mark
in interface PatternTokenizer
IOException
- if an I/O Error occurspublic boolean nextLine() throws java.io.IOException
nextLine
in interface PatternTokenizer
java.io.IOException
- if an I/O Error occurspublic void resetInput() throws java.io.IOException
resetInput
in interface PatternTokenizer
java.io.IOException
public void setDecimalPoint(char dp)
setDecimalPoint
in interface PatternTokenizer
public char getDecimalPoint()
getDecimalPoint
in interface PatternTokenizer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |