Package org.neuroph.contrib.imgrec

Examples of org.neuroph.contrib.imgrec.ImageRecognitionPlugin


     * @param charImage character image
     * @return recognized character
     */
    public Character recognizeCharacter(BufferedImage charImage) {
        // get the image recognition plugin from neural network
        ImageRecognitionPlugin imageRecognition = (ImageRecognitionPlugin) this.getParentNetwork().getPlugin(ImageRecognitionPlugin.class);

        HashMap<String, Double> output = imageRecognition.recognizeImage(charImage);
        HashMap<String, Neuron> n = imageRecognition.getMaxOutput();

        String ch = n.toString().substring(1, 2);
        return Character.valueOf(ch.charAt(0));
    }
View Full Code Here


     * @param charImage character image
     * @return HashMap with keys as characters and recognition probability as values
     */
    public HashMap recognizeCharacterProbabilities(BufferedImage charImage) {
        // get the image recognition plugin from neural network
        ImageRecognitionPlugin imageRecognition =
                (ImageRecognitionPlugin) this.getParentNetwork().getPlugin(ImageRecognitionPlugin.class);

        // image recognition is done here
        HashMap<String, Double> output = imageRecognition.recognizeImage(charImage);
        HashMap<Character, Double> recognized = sortHashMapByValues(output);

        return recognized;
    }
View Full Code Here

TOP

Related Classes of org.neuroph.contrib.imgrec.ImageRecognitionPlugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.