public class OCRManager
extends java.lang.Object
| Constructor and Description |
|---|
OCRManager()
Creates a new OCR manager, with default original values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSymbol(Symbol p_symbol)
Adds a symbol to the symbol table.
|
void |
analyse(double covarianceWeight,
double subtractionWeight,
ProgressListener listener)
Analyses all letters by running them through all nets.
|
void |
analyseSymbolWeights(ProgressListener listener)
Analyses and updates all symbol weights to compensate for individual net idiosynchrasies.
|
void |
appendNet(NeuralNet net)
Appends a net to the stack.
|
int |
countInputs()
Returns the number of inputs as shared across the net stack.
|
int |
countOutput()
Returns the number of outputs in the final layer of the entire net stack.
|
Document |
getDocument()
Returns the document that this OCRManager is using.
|
NeuralNet |
getNet(int p_index)
Returns a net from the given index number.
|
NeuralNet[] |
getNets()
Returns all nets from the net stack, is merely a wrapper for the Net stack object.
|
ReceptorManager |
getReceptorManager()
Returns the current ReceptorManager that will be used for analysis.
|
SymbolTable |
getSymbolTable()
Returns the entire current sumbol table.
|
void |
loadImage(java.io.File p_file)
Sets the current document's image source.
|
void |
loadSymbols(java.io.File f)
Loads a symbol table from the given file.
|
void |
moveNet(int p_indexFrom,
int p_indexTo)
Moves a net in the stack.
|
void |
removeNet(int p_index)
Removes a net from the internal list.
|
void |
removeNet(NeuralNet net)
Removes a net from the stack.
|
void |
setAllWeights(double p_weight)
Resets all symbol weights to the given number.
|
void |
setDocument(Document p_doc)
Sets the document to parse.
|
void |
setReceptorManager(ReceptorManager p_manager)
Sets the receptor manager.
|
void |
slice(double p_thresholdX,
double p_thresholdY)
Attempts to find letters by dividing an image up by lines and letters.
|
public OCRManager()
public int countOutput()
public void setReceptorManager(ReceptorManager p_manager)
p_manager - The ReceptorManager to use for analysis.public ReceptorManager getReceptorManager()
public void removeNet(int p_index)
throws java.lang.IndexOutOfBoundsException,
ItemNotFoundException,
ValueOutOfBoundsException
p_index - The index number of the net to removeIndexOutOfBoundsException - In the event that no net existsjava.lang.IndexOutOfBoundsExceptionItemNotFoundExceptionValueOutOfBoundsExceptionpublic NeuralNet[] getNets()
public NeuralNet getNet(int p_index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsExceptionpublic int countInputs()
public void moveNet(int p_indexFrom,
int p_indexTo)
p_indexFrom - The index of the net to movep_indexTo - The index where the net will be placedpublic void removeNet(NeuralNet net) throws ItemNotFoundException, ValueOutOfBoundsException
net - The neural net to remove from the net stack.ItemNotFoundExceptionValueOutOfBoundsExceptionpublic void appendNet(NeuralNet net) throws ValueOutOfBoundsException
net - The net to append to the net stack.ValueOutOfBoundsException - in the event that the number of inputs does not match that of the other loaded nets.public void addSymbol(Symbol p_symbol)
p_symbol - The symbol to add to the currently loaded symbol tablepublic void loadSymbols(java.io.File f)
throws java.io.IOException
f - The file to load a symbol table from.java.io.IOException - In the event that any error occurs during loadingpublic SymbolTable getSymbolTable()
public Document getDocument()
public void setDocument(Document p_doc)
p_doc - The document to set as the current document in this OCR manager.public void loadImage(java.io.File p_file)
throws java.io.IOException
p_file - The image file to read into the document.java.io.IOExceptionpublic void analyse(double covarianceWeight,
double subtractionWeight,
ProgressListener listener)
listener - A ProgressListener that is to watch the progress of the operation, which could take some time.public void setAllWeights(double p_weight)
p_weight - The number to set all weights topublic void analyseSymbolWeights(ProgressListener listener)
listener - A ProgressListener that is to watch the progress of the operation, which could take some time.public void slice(double p_thresholdX,
double p_thresholdY)
p_thresholdX - The X-direction threshold for cutting up images (switches the tracer on/off based on averages valuesp_thresholdY - The Y-direction threshold for cutting images up