Neuroph

org.neuroph.contrib.ocr
Class OcrPlugin

java.lang.Object
  extended by org.neuroph.util.plugins.PluginBase
      extended by org.neuroph.contrib.ocr.OcrPlugin
All Implemented Interfaces:
java.io.Serializable

public class OcrPlugin
extends PluginBase
implements java.io.Serializable

Provides OCR interface for neural network.

See Also:
Serialized Form

Field Summary
static java.lang.String OCR_PLUGIN_NAME
          Ocr plugin name field used for getting plugin from parent neural network.
 
Constructor Summary
OcrPlugin(java.awt.Dimension samplingResolution, ColorMode colorMode)
          Constructor, creates new OCR Plugin for specified sampling resolution and color mode
 
Method Summary
 ColorMode getColorMode()
          Returns color mode used for OCR
 java.awt.Dimension getSamplingResolution()
          Returns sampling resolution used for OCR
 java.lang.Character recognizeCharacter(java.awt.image.BufferedImage charImage)
          Recognizes character from the image and returns character
 java.lang.Character recognizeCharacter(java.awt.image.BufferedImage charImage, java.awt.Dimension scaleToDim)
          This method scales character image to the given dimensions and then does the character recognition.
 java.util.HashMap recognizeCharacterProbabilities(java.awt.image.BufferedImage charImage)
          Recogize the character from the image and returns HashMap with keys as characters and recognition probability as values sorted descending by probability.
 
Methods inherited from class org.neuroph.util.plugins.PluginBase
getName, getParentNetwork, setParentNetwork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OCR_PLUGIN_NAME

public static final java.lang.String OCR_PLUGIN_NAME
Ocr plugin name field used for getting plugin from parent neural network.

See Also:
Constant Field Values
Constructor Detail

OcrPlugin

public OcrPlugin(java.awt.Dimension samplingResolution,
                 ColorMode colorMode)
Constructor, creates new OCR Plugin for specified sampling resolution and color mode

Parameters:
samplingResolution - image sampling resolution (dimensions)
colorMode - recognition color mode
Method Detail

recognizeCharacter

public java.lang.Character recognizeCharacter(java.awt.image.BufferedImage charImage,
                                              java.awt.Dimension scaleToDim)
This method scales character image to the given dimensions and then does the character recognition. Returns recognized character.

Parameters:
charImage - character image
scaleToDim - dimensions to scale the image before character recognition is done
Returns:
recognized character

recognizeCharacter

public java.lang.Character recognizeCharacter(java.awt.image.BufferedImage charImage)
Recognizes character from the image and returns character

Parameters:
charImage - character image
Returns:
recognized character

recognizeCharacterProbabilities

public java.util.HashMap recognizeCharacterProbabilities(java.awt.image.BufferedImage charImage)
Recogize the character from the image and returns HashMap with keys as characters and recognition probability as values sorted descending by probability.

Parameters:
charImage - character image
Returns:
HashMap with keys as characters and recognition probability as values

getColorMode

public ColorMode getColorMode()
Returns color mode used for OCR

Returns:
color mode used for OCR

getSamplingResolution

public java.awt.Dimension getSamplingResolution()
Returns sampling resolution used for OCR

Returns:
sampling resolution used for OCR

Neuroph