Ignore:
Timestamp:
2019-07-22T16:46:33+12:00 (5 years ago)
Author:
cpb16
Message:

transferred backup of low res images. Classifiers work as expected. Updated javaAccuracyCalculator, now calculates overall rating correctly. Created gen-50-XX-ValidIDList.txt for the 10% high-res downloads. Done by selecting first 50 of each gen-500-XX-Valid.... .txt. Downloading high-res images after this backup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/is-sheet-music-encore/trunk/image-identification-development/src/Main.java

    r33326 r33340  
    144144            return "Start: " + _p1 + " End: " + _p2;
    145145        }
    146         /*
    147         //CompareToOverride
    148         //Compares start point y co ordinates of input PointArray
    149         //With this. start point y co ordinate
    150         @Override
    151         public double compareTo(StartAndEndPoint comparePointArray){
    152             Point comparePoint = (comparePointArray.getP1());
    153             return (this.getP1().y) - (comparePoint.y);
    154         }
    155         */
    156     }
     146
     147    }
     148
    157149    public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list) {
    158150        //DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED
     
    211203    }
    212204    public static Boolean lineComparison(double baseLineS, double compareLineS, double compareLineE ){
     205        //System.out.print("Comparing baseLineS: " + baseLineS + " with compareLineE: " + compareLineE + " and compareLineS: " + compareLineS);
    213206        if(baseLineS < compareLineE && baseLineS > compareLineS){
    214207            return true;
     
    231224            Boolean consistent = false;
    232225            if (variance <= CLUSTER_DISTANCE_MAX && variance > CLUSTER_DISTANCE_MIN) {
     226
    233227                for (int i = 0; i < parseArray.length - 1; i++) {
    234228                    //System.out.println(i);
     
    658652                            //If it SD is less than 5 then it is considered to be a cluster of lines.
    659653                            if(ClusterCheck(tempPtArray)){
    660                                 //System.out.println("tempArray PT: "+tempArray[0] + " , " + tempArray[1] + " , " + tempArray[2] + " , " + tempArray[3]);
    661                                 //System.out.println("tempArray SD: " + StandardDeviation(tempArray));
     654                                //System.out.println("tempArray PT: "+tempPtArray[0] + " , " + tempPtArray[1] + " , " + tempPtArray[2] + " , " + tempPtArray[3]);
    662655                                //Store array
    663656                                clusterPtArray.add(tempPtArray);
     
    671664                                    //break
    672665                                    Thread.sleep(2000);
    673                                     System.out.println("End of closeLinePts -> break , i = " + i+ " closeLineYpos size= " + closeLinePts.size());
     666                                    //System.out.println("End of closeLinePts -> break , i = " + i+ " closeLineYpos size= " + closeLinePts.size());
    674667                                    break;
    675668                                }
     
    678671                    }
    679672                }
    680                 /*
    681                 System.out.println("Cluster Coordinates: ");
    682                 for(double[] items : clusterArray){
    683                     for(int i = 0; i <items.length; i++){
    684                         System.out.println("ITEMS: "+ items[i]);
    685                     }
    686                 }
    687                 */
     673
     674                /*System.out.println("Cluster Coordinates: ");
     675                for(StartAndEndPoint[] items : clusterPtArray){
     676                    for(int i = 0; i <clusterPtArray.size(); i++){
     677                        System.out.println("ITEMS: "+ items);
     678                    }
     679                }*/
     680
    688681                //Setup Drawing clusters found.
    689682                //For every pt given the input array
     
    723716    }
    724717
     718    //SUPER CLASSIFIER FUNCTIONS
     719    private static boolean LineCountOrCluster(int lineCount, ArrayList<StartAndEndPoint> linePointsArray, Mat clustersFoundRGB){
     720        ArrayList lineClusterResult = ClassifierLineClusterPt(linePointsArray, clustersFoundRGB);
     721
     722
     723        //String test = ClassifierLineClusterPt(linePointsArray, clustersFoundRGB).get(0).toString();
     724        if(ClassifierLineCount(lineCount) == true){
     725            System.out.println("LineCount classifier Successful: " +   '\t' +"LinesFound: " + lineCount);
     726            return true;
     727        }
     728        else if(lineClusterResult.get(0).toString() == "true"){
     729            System.out.println("LineCluster classifier Successful: " + '\t' + "LinesFound: " + lineCount + '\t' + "ClustersFound: " + lineClusterResult.get(1));
     730
     731            return  false;
     732        }
     733        return false;
     734    }
     735
    725736    //MAIN
    726737    public static void main(String[] args) {
     
    735746            Mat edgesDetectedRGB = new Mat();
    736747            Mat clustersFoundRGB = new Mat();
    737             String directory = "/Scratch/cpb16/is-sheet-music-encore/download-images/MU/";
     748            String directory = "/Scratch/cpb16/is-sheet-music-encore/lowres-download-images/MU/";
    738749            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    739750            //mdp.39015097852365-2.png 176 lines    Contents page.
    740751            //mdp.39015097852555-3.png 76  lines
    741             //String default_file = directory+"SheetMusic/coo.31924062612282-9.png";
    742             //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
     752            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOTNOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     753            //coo.31924062612282-9.png 8   lines
     754            //String default_file = directory+"NotSheetMusic/coo.31924062612282-9.png";
     755            //String default_file = directory+"NotSheetMusic/mdp.39015097852365-2.png";
     756            String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
    743757
    744758
    745759            //System.out.println(default_file);
    746             String default_file = "TestImages/NotSheetMusic01.png";
     760            //String default_file = "TestImages/NotSheetMusic01.png";
    747761            //String default_file = "TestImages/NotSheetMusic02.png";
    748762            //String default_file = "TestImages/SheetMusic01.png";
     
    805819
    806820
    807             System.out.println("LINE COUNT RESULT:   " +  ClassifierLineCount(horizontalLineCount) + '\t' +"LinesFound: " + horizontalLineCount); //COUNT OF LINES CLASSIFICATION
     821            //System.out.println("LINE COUNT RESULT:   " +  ClassifierLineCount(horizontalLineCount) + '\t' +"LinesFound: " + horizontalLineCount); //COUNT OF LINES CLASSIFICATION
    808822            //System.out.println("LINE CLUSTER RESULT: " +  ClassifierLineClusterOLD(toBeClassifiedImg).get(0) + '\t' + "LinesFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(1) + '\t' + "ClustersFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(2));
    809             System.out.println("NEW CLUSTER RESULTS: " +  ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(0) + '\t' + "LinesFound: " + horizontalLineCount + '\t' + "ClustersFound: " + ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(1));
     823            //System.out.println("NEW CLUSTER RESULTS: " +  ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(0) + '\t' + "LinesFound: " + horizontalLineCount + '\t' + "ClustersFound: " + ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(1));
    810824            //System.out.println(ClassifierLineClusterPt(pointArrayList, clustersFoundRGB));
     825
     826            System.out.println("TEST: " + LineCountOrCluster(horizontalLineCount, pointArrayList, clustersFoundRGB));
    811827
    812828            // Wait and Exit
Note: See TracChangeset for help on using the changeset viewer.