Ignore:
Timestamp:
2019-08-28T17:03:18+12:00 (5 years ago)
Author:
cpb16
Message:

Have created properties file and accessibility from javaClassifierComparision. Have created download middle page only variant of image-downloader system. Have created EndToEndSystem bash script that will be used as makefile, with makefile being used to execute preset useful commands to the EndToEndSystem. It needs to be fleshed out as only has one script, this script can run a classifier and place the results into a subdirectory defined by the user

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java

    r33437 r33439  
    88import java.awt.image.BufferedImage;
    99import java.awt.image.DataBufferByte;
     10import java.io.FileInputStream;
     11import java.io.IOException;
    1012//import java.io.File;
    1113//import java.io.BufferedWriter;
     
    1618//import java.util.Collections.*;
    1719import java.util.*;
     20//import java.util.Properties;
    1821import java.lang.*;
    1922import java.io.*;
     
    3437//False =classifierType + 0 + Filename + Status
    3538public class javaClassifierComparison {
    36 
    37     //MAKE THIS A PROPERTIES FILE. THIS WILL BE SET AND CHECKED FROM OUTSIDE THE LOOP
    38     //GLOBALS Constants
     39   
     40//*******************************************************************************************
     41//GLOBALS
     42//*******************************************************************************************
     43/*     
     44    //HOUGHLINE
    3945    static int CLASSIFIER_HOUGHLINESP_MIN = 10;
    4046    static int CLASSIFIER_HOUGHLINESP_MAX = 65;
     
    5056    static double THRESHOLD_AREA_SIZE  = 1000;
    5157    static double THRESHOLD_AREA_COUNT = 4;
    52 
    53 
     58*/
     59    static int CLASSIFIER_HOUGHLINESP_MIN;
     60    static int CLASSIFIER_HOUGHLINESP_MAX;
     61    static int HOUGHLINEP_THRESHOLD;
     62    static int STANDARD_DEVIATION_THRESHOLD;
     63    static int MINLINECOUNT;
     64    static int MAXLINEGAP;
     65    static double THRESHOLD_C;
     66    static double SLOPEGRADIENT;
     67    static double CLUSTER_DISTANCE_MAX;
     68    static double CLUSTER_DISTANCE_MIN;
     69    //MORPHOLOGY
     70    static double THRESHOLD_AREA_SIZE;
     71    static double THRESHOLD_AREA_COUNT;
     72
     73//********************************************************************************************
     74//CLASSES
     75//********************************************************************************************
     76   
     77    //Sets globals based off properties file
     78    public static void init(){
     79        try{
     80            Properties config = new Properties();
     81            FileInputStream input = new FileInputStream("configClassifierComparison.properties");
     82            config.load(input);
     83            CLASSIFIER_HOUGHLINESP_MIN =    Integer.parseInt(config.getProperty("CLASSIFIER_HOUGHLINESP_MIN"));
     84            CLASSIFIER_HOUGHLINESP_MAX =    Integer.parseInt(config.getProperty("CLASSIFIER_HOUGHLINESP_MAX"));
     85            HOUGHLINEP_THRESHOLD =          Integer.parseInt(config.getProperty("HOUGHLINEP_THRESHOLD"));
     86            STANDARD_DEVIATION_THRESHOLD =  Integer.parseInt(config.getProperty("STANDARD_DEVIATION_THRESHOLD"));
     87            MINLINECOUNT =                  Integer.parseInt(config.getProperty("MINLINECOUNT"));
     88            MAXLINEGAP =                    Integer.parseInt(config.getProperty("MAXLINEGAP"));
     89            THRESHOLD_C =                   Double.parseDouble(config.getProperty("THRESHOLD_C"));
     90            SLOPEGRADIENT =                 Double.parseDouble(config.getProperty("SLOPEGRADIENT"));
     91            CLUSTER_DISTANCE_MAX =          Double.parseDouble(config.getProperty("CLUSTER_DISTANCE_MAX"));
     92            CLUSTER_DISTANCE_MIN =          Double.parseDouble(config.getProperty("CLUSTER_DISTANCE_MIN"));
     93            THRESHOLD_AREA_SIZE =           Double.parseDouble(config.getProperty("THRESHOLD_AREA_SIZE"));
     94            THRESHOLD_AREA_COUNT =          Double.parseDouble(config.getProperty("THRESHOLD_AREA_COUNT"));
     95        }
     96        catch(Exception e){
     97            e.printStackTrace();
     98        }
     99    }
     100   
    54101    static public class StartAndEndPoint {
    55102        //PRIVATES
     
    114161
    115162    public static void main(String[] args) {
     163        init();
    116164        try {
     165       
    117166            if (args.length != 3) {
    118167                System.out.println("Usage: imageClassifier <inputFilename> <classifierType> <outputFilename>");
     
    134183                //Split output by tab for processing in next java program
    135184                //imageFilename = 1, result = 3, classifierType = 4
     185               
    136186                switch (classifierType) {
    137187                    case "count":
     
    156206                        System.out.println("unknown algorithm");
    157207                        break;
    158                 }
     208                }     
     209               
    159210                bw.close();
    160211            }
Note: See TracChangeset for help on using the changeset viewer.