Neuroph

org.neuroph.contrib.imgrec
Class ImageRecognitionPlugin

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

public class ImageRecognitionPlugin
extends PluginBase
implements java.io.Serializable

Provides image recognition specific properties like sampling resolution, and easy to use image recognition interface for neural network.

See Also:
Serialized Form

Field Summary
static java.lang.String IMG_REC_PLUGIN_NAME
           
 
Constructor Summary
ImageRecognitionPlugin(java.awt.Dimension samplingResolution)
          Constructor
 
Method Summary
 java.util.HashMap<java.lang.String,Neuron> getMaxOutput()
          Returns one or more image labels with the maximum output - recognized images
 java.util.HashMap<java.lang.String,java.lang.Double> getOutput()
          Returns image recognition result as map with image labels as keys and recogition result as value
 java.awt.Dimension getSamplingResolution()
          Returns image sampling resolution (dimensions)
 void processInput()
           
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.awt.image.BufferedImage img)
          This method performs the image recognition for specified image.
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.awt.image.BufferedImage img, ColorMode colorMode)
          This method performs the image recognition for the specified image in specified color mode.
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.io.File imgFile)
          This method performs the image recognition for specified image file.
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.io.File imgFile, ColorMode colorMode)
          This method performs the image recognition for the specified image file in specified color mode.
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.net.URL imgURL)
          This method performs the image recognition for specified image URL.
 java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.net.URL imgURL, ColorMode colorMode)
          This method performs the image recognition for the specified image URL in specified color mode.
 void setInput(java.awt.image.BufferedImage img)
          Sets network input (image to recognize) from the specified BufferedImage object
 void setInput(java.awt.image.BufferedImage img, ColorMode colorMode)
          Sets network input (image to recognize) from the specified BufferedImage object
 void setInput(java.io.File imgFile)
          Sets network input (image to recognize) from the specified File object
 void setInput(java.io.File imgFile, ColorMode colorMode)
          Sets network input (image to recognize) from the specified File object
 void setInput(java.net.URL imgURL)
          Sets network input (image to recognize) from the specified URL object
 void setInput(java.net.URL imgURL, ColorMode colorMode)
          Sets network input (image to recognize) from the specified URL object
 
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

IMG_REC_PLUGIN_NAME

public static final java.lang.String IMG_REC_PLUGIN_NAME
See Also:
Constant Field Values
Constructor Detail

ImageRecognitionPlugin

public ImageRecognitionPlugin(java.awt.Dimension samplingResolution)
Constructor

Parameters:
samplingResolution - image sampling resolution (dimensions)
Method Detail

getSamplingResolution

public java.awt.Dimension getSamplingResolution()
Returns image sampling resolution (dimensions)

Returns:
image sampling resolution (dimensions)

setInput

public void setInput(java.awt.image.BufferedImage img)
Sets network input (image to recognize) from the specified BufferedImage object

Parameters:
img - image to recognize

setInput

public void setInput(java.io.File imgFile)
              throws java.io.IOException
Sets network input (image to recognize) from the specified File object

Parameters:
imgFile - file of the image to recognize
Throws:
java.io.IOException

setInput

public void setInput(java.net.URL imgURL)
              throws java.io.IOException
Sets network input (image to recognize) from the specified URL object

Parameters:
imgURL - url of the image
Throws:
java.io.IOException

setInput

public void setInput(java.awt.image.BufferedImage img,
                     ColorMode colorMode)
Sets network input (image to recognize) from the specified BufferedImage object

Parameters:
img - image to recognize
colorMode - color mode to use

setInput

public void setInput(java.io.File imgFile,
                     ColorMode colorMode)
              throws java.io.IOException
Sets network input (image to recognize) from the specified File object

Parameters:
imgFile - file of the image to recognize
colorMode - color mode to use
Throws:
java.io.IOException

setInput

public void setInput(java.net.URL imgURL,
                     ColorMode colorMode)
              throws java.io.IOException
Sets network input (image to recognize) from the specified URL object

Parameters:
imgURL - url of the image
colorMode - color mode to use
Throws:
java.io.IOException

processInput

public void processInput()

getOutput

public java.util.HashMap<java.lang.String,java.lang.Double> getOutput()
Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.awt.image.BufferedImage img)
This method performs the image recognition for specified image. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.awt.image.BufferedImage img,
                                                                           ColorMode colorMode)
This method performs the image recognition for the specified image in specified color mode. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.io.File imgFile)
                                                                    throws java.io.IOException
This method performs the image recognition for specified image file. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result
Throws:
java.io.IOException

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.io.File imgFile,
                                                                           ColorMode colorMode)
                                                                    throws java.io.IOException
This method performs the image recognition for the specified image file in specified color mode. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result
Throws:
java.io.IOException

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.net.URL imgURL)
                                                                    throws java.io.IOException
This method performs the image recognition for specified image URL. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result
Throws:
java.io.IOException

recognizeImage

public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.net.URL imgURL,
                                                                           ColorMode colorMode)
                                                                    throws java.io.IOException
This method performs the image recognition for the specified image URL in specified color mode. Returns image recognition result as map with image labels as keys and recogition result as value

Returns:
image recognition result
Throws:
java.io.IOException

getMaxOutput

public java.util.HashMap<java.lang.String,Neuron> getMaxOutput()
Returns one or more image labels with the maximum output - recognized images

Returns:
one or more image labels with the maximum output

Neuroph