org.neuroph.imgrec
Class ImageRecognitionPlugin
- java.lang.Object
-
- org.neuroph.util.plugins.PluginBase
-
- org.neuroph.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
Fields Modifier and Type Field and Description static java.lang.StringIMG_REC_PLUGIN_NAME
-
Constructor Summary
Constructors Constructor and Description ImageRecognitionPlugin(Dimension samplingResolution)ConstructorImageRecognitionPlugin(Dimension samplingResolution, ColorMode colorMode)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ColorModegetColorMode()Returns color mode used for image recognitionjava.util.HashMap<java.lang.String,Neuron>getMaxOutput()Returns one or more image labels with the maximum output - recognized imagesjava.util.HashMap<java.lang.String,java.lang.Double>getOutput()Returns image recognition result as map with image labels as keys and recogition result as valueDimensiongetSamplingResolution()Returns image sampling resolution (dimensions)voidprocessInput()java.util.HashMap<java.lang.String,java.lang.Double>recognizeImage(java.awt.image.BufferedImage img)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(Image img)This method performs the image recognition for specified image.java.util.HashMap<java.lang.String,java.lang.Double>recognizeImage(java.net.URL imgURL)This method performs the image recognition for specified image URL.voidsetInput(java.io.File imgFile)Sets network input (image to recognize) from the specified File objectvoidsetInput(Image img)Sets network input (image to recognize) from the specified BufferedImage objectvoidsetInput(java.net.URL imgURL)Sets network input (image to recognize) from the specified URL object-
Methods inherited from class org.neuroph.util.plugins.PluginBase
getName, getParentNetwork, setParentNetwork
-
-
-
-
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(Dimension samplingResolution)
Constructor- Parameters:
samplingResolution- image sampling resolution (dimensions)
-
-
Method Detail
-
getSamplingResolution
public Dimension getSamplingResolution()
Returns image sampling resolution (dimensions)- Returns:
- image sampling resolution (dimensions)
-
getColorMode
public ColorMode getColorMode()
Returns color mode used for image recognition- Returns:
- color mode used for image recognition
-
setInput
public void setInput(Image img) throws ImageSizeMismatchException
Sets network input (image to recognize) from the specified BufferedImage object- Parameters:
img- image to recognize- Throws:
ImageSizeMismatchException
-
setInput
public void setInput(java.io.File imgFile) throws java.io.IOException, ImageSizeMismatchExceptionSets network input (image to recognize) from the specified File object- Parameters:
imgFile- file of the image to recognize- Throws:
java.io.IOExceptionImageSizeMismatchException
-
setInput
public void setInput(java.net.URL imgURL) throws java.io.IOException, ImageSizeMismatchExceptionSets network input (image to recognize) from the specified URL object- Parameters:
imgURL- url of the image- Throws:
java.io.IOExceptionImageSizeMismatchException
-
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(Image img) throws ImageSizeMismatchException
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
- Throws:
ImageSizeMismatchException
-
recognizeImage
public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.awt.image.BufferedImage img) throws ImageSizeMismatchException- Throws:
ImageSizeMismatchException
-
recognizeImage
public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.io.File imgFile) throws java.io.IOException, ImageSizeMismatchExceptionThis 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.IOExceptionImageSizeMismatchException
-
recognizeImage
public java.util.HashMap<java.lang.String,java.lang.Double> recognizeImage(java.net.URL imgURL) throws java.io.IOException, ImageSizeMismatchExceptionThis 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.IOExceptionImageSizeMismatchException
-
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
-
-
DMelt 3.0 © DataMelt by jWork.ORG