From c506068be0b5d7493e81650b2d9c4a21c658ddb1 Mon Sep 17 00:00:00 2001 From: Garcel Date: Sun, 5 Oct 2014 12:07:09 +0200 Subject: [PATCH 1/3] Added javadoc comments to Main class Javadoc comments for: - Main class. - Main class attributes. - Main class methods. --- src/main/java/net/sf/javaanpr/jar/Main.java | 54 ++++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/sf/javaanpr/jar/Main.java b/src/main/java/net/sf/javaanpr/jar/Main.java index 9a93e78..25f97a3 100644 --- a/src/main/java/net/sf/javaanpr/jar/Main.java +++ b/src/main/java/net/sf/javaanpr/jar/Main.java @@ -81,9 +81,37 @@ The name and trademarks of copyright holder(s) may NOT be used in import net.sf.javaanpr.intelligence.Intelligence; import net.sf.javaanpr.recognizer.NeuralPatternClassificator; +/** + * + *

Main class which initializes the project, taking input parameters from command line and then running the project accordingly.

+ * + * Allowed parameters are: + * + * + * @author Ondrej Martinsky. + * + */ public class Main { - public static ReportGenerator rg = new ReportGenerator(); + + /** + * The report generator. + */ + public static ReportGenerator rg = new ReportGenerator(); + /** + * The intelligence. + */ public static Intelligence systemLogic; + /** + * The help message. + */ public static String helpText = "" + "-----------------------------------------------------------\n" + "Automatic number plate recognition system\n" + "Copyright (c) Ondrej Martinsky, 2006-2007\n" + "\n" + "Licensed under the Educational Community License,\n" + "\n" + "Usage : java -jar anpr.jar [-options]\n" @@ -99,8 +127,13 @@ public class Main { + " and saves it into output file\n" + " -newalphabet -i -o \n" + " Normalize all images in and save\n" + " it to ."; - // normalizuje abecedu v zdrojovom adresari a vysledok ulozi do cieloveho - // adresara + /** + * Normalizes the alphabet in the source directory and writes the result to the target directory. + * + * @param srcdir the source directory. + * @param dstdir the destination directory. + * @throws IOException + */ public static void newAlphabet(String srcdir, String dstdir) throws IOException { // NOT USED int x = Configurator.getConfigurator().getIntProperty("char_normalizeddimensions_x"); @@ -116,8 +149,12 @@ public static void newAlphabet(String srcdir, String dstdir) throws IOException } } - // DONE z danej abecedy precita deskriptory, tie sa nauci, a ulozi neuronovu - // siet + /** + * Train neural network according to specified feature extraction method and learning parameters (in config. file) and saves it into output file . + * + * @param destinationFile the destination file. + * @throws Exception + */ public static void learnAlphabet(String destinationFile) throws Exception { try { File f = new File(destinationFile); @@ -130,6 +167,12 @@ public static void learnAlphabet(String destinationFile) throws Exception { npc.network.saveToXml(destinationFile); } + /** + * Main method which parses the input parameters and then runs the project accordingly. + * + * @param args the input parameters. + * @throws Exception + */ public static void main(String[] args) throws Exception { if ((args.length == 0) || ((args.length == 1) && args[0].equals("-gui"))) { @@ -187,6 +230,5 @@ public static void main(String[] args) throws Exception { // DONE display help System.out.println(Main.helpText); } - } } \ No newline at end of file From 95e61971a4765836af56984f37ec632d583ff855 Mon Sep 17 00:00:00 2001 From: Garcel Date: Mon, 6 Oct 2014 17:00:15 +0200 Subject: [PATCH 2/3] Fix for my first pull request Fix for my first pull request to fit project requirements. -Deleted some unnecessary lines. -Deleted some trailing white spaces. -Deleted unnecessary indentation. -Changed tabs for spaces. --- src/main/java/net/sf/javaanpr/jar/Main.java | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/sf/javaanpr/jar/Main.java b/src/main/java/net/sf/javaanpr/jar/Main.java index 25f97a3..4a35203 100644 --- a/src/main/java/net/sf/javaanpr/jar/Main.java +++ b/src/main/java/net/sf/javaanpr/jar/Main.java @@ -82,18 +82,19 @@ The name and trademarks of copyright holder(s) may NOT be used in import net.sf.javaanpr.recognizer.NeuralPatternClassificator; /** - * - *

Main class which initializes the project, taking input parameters from command line and then running the project accordingly.

+ *

Main class which initializes the project, taking input parameters from command line and then running the project + * accordingly.

* * Allowed parameters are: *
    - *
  • -help Displays the help messsage. - *
  • -gui Run GUI viewer (default choice). - *
  • -recognize -i "snapshot" Recognize single snapshot. - *
  • -recognize -i "snapshot" -o "dstdir" Recognize single snapshot and save report html into specified directory . - *
  • -newconfig -o "file" Generate default configuration file. - *
  • -newnetwork -o "file" Train neural network according to specified feature extraction method and learning parameters (in config. file) and saves it into output file. - *
  • -newalphabet -i "srcdir" -o "dstdir" Normalize all images in "srcdir" and save it to "dstdir". + *
  • -help Displays the help messsage. + *
  • -gui Run GUI viewer (default choice). + *
  • -recognize -i "snapshot" Recognize single snapshot. + *
  • -recognize -i "snapshot" -o "dstdir" Recognize single snapshot and save report html into specified directory. + *
  • -newconfig -o "file" Generate default configuration file. + *
  • -newnetwork -o "file" Train neural network according to specified feature extraction method and learning + * parameters (in config. file) and saves it into output file. + *
  • -newalphabet -i "srcdir" -o "dstdir" Normalize all images in "srcdir" and save it to "dstdir". *
* * @author Ondrej Martinsky. @@ -150,7 +151,8 @@ public static void newAlphabet(String srcdir, String dstdir) throws IOException } /** - * Train neural network according to specified feature extraction method and learning parameters (in config. file) and saves it into output file . + * Train neural network according to specified feature extraction method and learning parameters (in config. file) + * and saves it into output file. * * @param destinationFile the destination file. * @throws Exception From 9408bee703fb1860c4b11cfc022620383bd504f2 Mon Sep 17 00:00:00 2001 From: Garcel Date: Mon, 6 Oct 2014 17:46:21 +0200 Subject: [PATCH 3/3] Changed tab for space --- src/main/java/net/sf/javaanpr/jar/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/sf/javaanpr/jar/Main.java b/src/main/java/net/sf/javaanpr/jar/Main.java index 4a35203..1d91ada 100644 --- a/src/main/java/net/sf/javaanpr/jar/Main.java +++ b/src/main/java/net/sf/javaanpr/jar/Main.java @@ -105,7 +105,7 @@ public class Main { /** * The report generator. */ - public static ReportGenerator rg = new ReportGenerator(); + public static ReportGenerator rg = new ReportGenerator(); /** * The intelligence. */