Index: /other-projects/is-sheet-music-encore/trunk/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33449)
@@ -28,5 +28,5 @@
 	
 run-morphology-20-test:
-	#cd image-identification-terminal/log-all-hires-new/test; rm log-morphology-MU-test.txt
+	cd image-identification-terminal/log-all-hires-new/test; rm log-morphology-MU-test.txt
 	cd image-identification-terminal; javac javaAccuracyCalculator.java
 	cd image-identification-terminal; javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaClassifierComparison.java;
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml	(revision 33449)
@@ -15,6 +15,6 @@
         <entry file="file://$PROJECT_DIR$/image-identification-development/src/Main.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-969">
-              <caret line="803" selection-start-line="803" selection-end-line="803" />
+            <state relative-caret-position="-53">
+              <caret line="746" column="42" selection-start-line="746" selection-start-column="42" selection-end-line="746" selection-end-column="42" />
               <folding>
                 <element signature="imports" expanded="true" />
@@ -40,24 +40,20 @@
         <entry file="file://$PROJECT_DIR$/image-identification-development/src/MainMorph.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="321">
-              <caret line="855" column="42" selection-start-line="855" selection-start-column="42" selection-end-line="855" selection-end-column="42" />
+            <state relative-caret-position="33">
+              <caret line="143" column="32" selection-start-line="143" selection-start-column="32" selection-end-line="143" selection-end-column="32" />
               <folding>
                 <element signature="imports" expanded="true" />
-                <element signature="e#10614#13084#1" />
-                <element signature="e#13169#15172#1" />
-                <element signature="e#15241#17864#1" />
-                <element signature="e#17947#23618#1" />
-                <element signature="e#23702#27679#1" />
-                <element signature="e#27746#28924#1" />
-                <element signature="e#28992#32955#1" />
-                <element signature="e#35980#35992#0" expanded="true" />
-                <element signature="e#37714#37726#0" expanded="true" />
-                <element signature="e#37797#37809#0" expanded="true" />
-                <element signature="e#41273#41282#0" expanded="true" />
-                <element signature="e#44803#56145#1" />
-                <element signature="e#48966#48978#0" expanded="true" />
-                <element signature="e#49049#49061#0" expanded="true" />
-                <element signature="e#49131#49143#0" expanded="true" />
-                <element signature="e#52896#52905#0" expanded="true" />
+                <element signature="class#Pair#0;class#MainMorph#0" />
+                <element signature="method#imageViewer#0;class#MainMorph#0" />
+                <element signature="e#11259#13729#1" />
+                <element signature="e#13814#15817#1" />
+                <element signature="e#15886#18509#1" />
+                <element signature="e#18593#24264#1" />
+                <element signature="e#24349#28326#1" />
+                <element signature="e#28394#29572#1" />
+                <element signature="e#29641#33604#1" />
+                <element signature="e#33714#45393#1" />
+                <element signature="e#42969#43036#0" />
+                <element signature="e#45494#55203#1" />
               </folding>
             </state>
@@ -68,20 +64,15 @@
         <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="406">
-              <caret line="606" column="5" lean-forward="true" selection-start-line="606" selection-start-column="5" selection-end-line="606" selection-end-column="5" />
+            <state relative-caret-position="338">
+              <caret line="135" column="4" selection-start-line="135" selection-start-column="4" selection-end-line="160" selection-end-column="5" />
               <folding>
                 <element signature="imports" expanded="true" />
                 <element signature="method#init#0;class#javaClassifierComparison#0" />
-                <element signature="e#3021#4256#0" />
                 <element signature="class#StartAndEndPoint#0;class#javaClassifierComparison#0" />
                 <element signature="class#Pair#0;class#javaClassifierComparison#0" />
                 <element signature="method#Algorithm_HoughLinesP_Single#0;class#javaClassifierComparison#0" />
                 <element signature="method#Algorithm_HoughLinesP_Combo#0;class#javaClassifierComparison#0" />
+                <element signature="method#Algorithm_MorphologyOLD#0;class#javaClassifierComparison#0" />
                 <element signature="method#Algorithm_Morphology#0;class#javaClassifierComparison#0" />
-                <element signature="method#Algorithm_Morphology#0;class#javaClassifierComparison#0" />
-                <element signature="e#20655#20667#0" expanded="true" />
-                <element signature="e#20738#20750#0" expanded="true" />
-                <element signature="e#20820#20832#0" expanded="true" />
-                <element signature="e#24593#24602#0" expanded="true" />
                 <element signature="method#Classifier_LineCounter#0;class#javaClassifierComparison#0" />
                 <element signature="method#Classifier_ClusterDetection#0;class#javaClassifierComparison#0" />
@@ -108,4 +99,5 @@
       <find>coo.31924062612282-9.png</find>
       <find>FILLED</find>
+      <find>test</find>
     </findStrings>
   </component>
@@ -244,6 +236,6 @@
     <entry file="file://$PROJECT_DIR$/image-identification-development/src/Main.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-969">
-          <caret line="803" selection-start-line="803" selection-end-line="803" />
+        <state relative-caret-position="-53">
+          <caret line="746" column="42" selection-start-line="746" selection-start-column="42" selection-end-line="746" selection-end-column="42" />
           <folding>
             <element signature="imports" expanded="true" />
@@ -267,20 +259,15 @@
     <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="406">
-          <caret line="606" column="5" lean-forward="true" selection-start-line="606" selection-start-column="5" selection-end-line="606" selection-end-column="5" />
+        <state relative-caret-position="338">
+          <caret line="135" column="4" selection-start-line="135" selection-start-column="4" selection-end-line="160" selection-end-column="5" />
           <folding>
             <element signature="imports" expanded="true" />
             <element signature="method#init#0;class#javaClassifierComparison#0" />
-            <element signature="e#3021#4256#0" />
             <element signature="class#StartAndEndPoint#0;class#javaClassifierComparison#0" />
             <element signature="class#Pair#0;class#javaClassifierComparison#0" />
             <element signature="method#Algorithm_HoughLinesP_Single#0;class#javaClassifierComparison#0" />
             <element signature="method#Algorithm_HoughLinesP_Combo#0;class#javaClassifierComparison#0" />
+            <element signature="method#Algorithm_MorphologyOLD#0;class#javaClassifierComparison#0" />
             <element signature="method#Algorithm_Morphology#0;class#javaClassifierComparison#0" />
-            <element signature="method#Algorithm_Morphology#0;class#javaClassifierComparison#0" />
-            <element signature="e#20655#20667#0" expanded="true" />
-            <element signature="e#20738#20750#0" expanded="true" />
-            <element signature="e#20820#20832#0" expanded="true" />
-            <element signature="e#24593#24602#0" expanded="true" />
             <element signature="method#Classifier_LineCounter#0;class#javaClassifierComparison#0" />
             <element signature="method#Classifier_ClusterDetection#0;class#javaClassifierComparison#0" />
@@ -295,24 +282,20 @@
     <entry file="file://$PROJECT_DIR$/image-identification-development/src/MainMorph.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="321">
-          <caret line="855" column="42" selection-start-line="855" selection-start-column="42" selection-end-line="855" selection-end-column="42" />
+        <state relative-caret-position="33">
+          <caret line="143" column="32" selection-start-line="143" selection-start-column="32" selection-end-line="143" selection-end-column="32" />
           <folding>
             <element signature="imports" expanded="true" />
-            <element signature="e#10614#13084#1" />
-            <element signature="e#13169#15172#1" />
-            <element signature="e#15241#17864#1" />
-            <element signature="e#17947#23618#1" />
-            <element signature="e#23702#27679#1" />
-            <element signature="e#27746#28924#1" />
-            <element signature="e#28992#32955#1" />
-            <element signature="e#35980#35992#0" expanded="true" />
-            <element signature="e#37714#37726#0" expanded="true" />
-            <element signature="e#37797#37809#0" expanded="true" />
-            <element signature="e#41273#41282#0" expanded="true" />
-            <element signature="e#44803#56145#1" />
-            <element signature="e#48966#48978#0" expanded="true" />
-            <element signature="e#49049#49061#0" expanded="true" />
-            <element signature="e#49131#49143#0" expanded="true" />
-            <element signature="e#52896#52905#0" expanded="true" />
+            <element signature="class#Pair#0;class#MainMorph#0" />
+            <element signature="method#imageViewer#0;class#MainMorph#0" />
+            <element signature="e#11259#13729#1" />
+            <element signature="e#13814#15817#1" />
+            <element signature="e#15886#18509#1" />
+            <element signature="e#18593#24264#1" />
+            <element signature="e#24349#28326#1" />
+            <element signature="e#28394#29572#1" />
+            <element signature="e#29641#33604#1" />
+            <element signature="e#33714#45393#1" />
+            <element signature="e#42969#43036#0" />
+            <element signature="e#45494#55203#1" />
           </folding>
         </state>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java	(revision 33449)
@@ -760,10 +760,15 @@
 
             //String default_file = hiresDirectory+ "MU/SheetMusic/mdp.39015096402204-2.png";
-            String default_file = hiresDirectory+ "MU/SheetMusic/mdp.39015096408490-3.png";
+            //String default_file = hiresDirectory+ "MU/SheetMusic/mdp.39015096408490-3.png";
+            //String default_file = hiresDirectory + "MU/SheetMusic/coo.31924062612282-9.png";
+
             //String default_file = directory+"NotSheetMusic/coo.31924062612282-9.png";
             //String default_file = directory+"NotSheetMusic/mdp.39015097852365-2.png";
             //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
             //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t2q53nq6w-6.png";
-            //String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/test-coo.31924062612282-9.png";
+
+            String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/test-coo.31924062612282-9.png";
+            //String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/mdp.39015080937769-1.png";
+            //String default_file = "/Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU/SheetMusic/coo.31924062612282-9.png";
             //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t9z03w65z-4.png";
 
@@ -776,4 +781,5 @@
             String filename = ((args.length > 0) ? args[0] : default_file);
             File file = new File(filename);
+
             if(!file.exists()){System.err.println("Image not found: "+ filename);}
 
@@ -782,4 +788,5 @@
             // Load an image
             Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            System.out.println("Width: " + original.width() + " Height: " + original.height());
             // Edge detection
 
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java	(revision 33449)
@@ -114,6 +114,33 @@
 
 public class MainMorph {
+    static public class Pair{
+        //Privates
+        private Boolean _b;
+        private Integer _i;
+
+        //Constructor
+        public Pair(Boolean b, Integer i){
+            _b = b;
+            _i = i;
+        }
+        public  Pair(){
+            _b = null;
+            _i = null;
+        }
+
+        //Getters
+        public Boolean getBoolean() {return _b;}
+        public Integer getInteger() {return _i;}
+
+        //Setters
+        public void setBoolean (Boolean b){_b = b;}
+        public void setInteger (Integer i){_i = i;}
+
+        //ToString
+        public String toString() {return  "Boolean: " + _b + " Integer: " + _i;}
+    }
+
     //CODE VERSIONS
-    static int CODE_VERSION  = 8;
+    static int CODE_VERSION  = 9;
     static int IMAGE_VERSION = 3;
     //GLOBAL_CONSTANTS
@@ -158,6 +185,4 @@
         }
     }
-
-
 
     //MAIN
@@ -192,7 +217,42 @@
             //String default_file =hiresDirectory+"MU/NotSheetMusic/mdp.39015096363935-1.png";
             //String default_file =hiresDirectory+"MU/SheetMusic/coo.31924062612282-9.png";
-
-            //System.out.println(default_file);
-            //String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/test-coo.31924062612282-9.png";
+            //String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/hi-res-test-coo.31924062612282-9.png";
+            //TestNew images used
+
+            //String default_file = hiresDirectory+"/MU/SheetMusic/aeu.ark+=13960=t93787r1w-10.png";
+            //String default_file = "hiresDirectory+"/MU/SheetMusic/bc.ark+=13960=t2j72dt1p-10.png";
+            //String default_file = hiresDirectory+"/MU/SheetMusic/bc.ark+=13960=t2j72dt1p-7.png";  //Handwritten
+            //String default_file = hiresDirectory+"/MU/SheetMusic/bc.ark+=13960=t2j72dt1p-8.png";  //Handwritten
+            //String default_file = hiresDirectory+"/MU/SheetMusic/bc.ark+=13960=t2j72dt1p-9.png";    //Handwritten
+            //String default_file = hiresDirectory+"/MU/SheetMusic/coo.31924062612282-9.png";
+            //String default_file = hiresDirectory+"/MU/SheetMusic/dul1.ark+=13960=t2x41569k-10.png";
+            //String default_file = hiresDirectory+"/MU/SheetMusic/dul1.ark+=13960=t2x41569k-7.png";
+            //String default_file = hiresDirectory+"/MU/SheetMusic/dul1.ark+=13960=t2x41569k-8.png";
+            //String default_file = hiresDirectory+"/MU/SheetMusic/dul1.ark+=13960=t2x41569k-9.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-10.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-1.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-2.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-3.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-4.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-5.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-6.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-7.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-8.png";
+            //String default_file = hiresDirectory+"/MU/NotSheetMusic/aeu.ark+=13960=t0dv28v9r-9.png";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
             //String default_file = testDirectory+"TestImages/MorphTester.png";
             //String default_file = testDirectory+"TestImages/NotSheetMusic01.png";
@@ -803,29 +863,28 @@
 
                 //*****************************************************************
-                //Circles and centres on processed images
+                //Circles on processed images
                 //*****************************************************************
-
-                //Init arrays
-                Mat circleOutput = allContoursFound.clone();
-                MatOfPoint2f[] contoursPoly  = new MatOfPoint2f[largeContours.size()];
-                Point[] centers = new Point[largeContours.size()];
-                float[][] radius = new float[largeContours.size()][1];
-
-                //Fill arrays
-                for (int i = 0; i < largeContours.size(); i++) {
-                    contoursPoly[i] = new MatOfPoint2f();
-                    Imgproc.approxPolyDP(new MatOfPoint2f(largeContours.get(i).toArray()), contoursPoly[i], 1, true);
-                    centers[i] = new Point();
-                    Imgproc.minEnclosingCircle(contoursPoly[i], centers[i], radius[i]);
-
-                }
-                //Draw circle for each large contour
-                for (int i = 0; i < largeContours.size(); i++) {
-                    Imgproc.circle(circleOutput, centers[i], (int) radius[i][0],new Scalar(255, 0, 0), 1);
-                }
-                imageViewer("82 Circles found", circleOutput);
+//                //Init arrays
+//                Mat circleOutput = allContoursFound.clone();
+//                MatOfPoint2f[] contoursPoly  = new MatOfPoint2f[largeContours.size()];
+//                Point[] centers = new Point[largeContours.size()];
+//                float[][] radius = new float[largeContours.size()][1];
+//
+//                //Fill arrays
+//                for (int i = 0; i < largeContours.size(); i++) {
+//                    contoursPoly[i] = new MatOfPoint2f();
+//                    Imgproc.approxPolyDP(new MatOfPoint2f(largeContours.get(i).toArray()), contoursPoly[i], 1, true);
+//                    centers[i] = new Point();
+//                    Imgproc.minEnclosingCircle(contoursPoly[i], centers[i], radius[i]);
+//
+//                }
+//                //Draw circle for each large contour
+//                for (int i = 0; i < largeContours.size(); i++) {
+//                    Imgproc.circle(circleOutput, centers[i], (int) radius[i][0],new Scalar(255, 0, 0), 1);
+//                }
+//                imageViewer("82 Circles found", circleOutput);
 
                 //********************************************************************************
-                //Centroids - Everything must be to scale
+                //Centroids -Everything must be to scale
                 //********************************************************************************
 
@@ -908,55 +967,51 @@
             if(CODE_VERSION == 81) {
 
-                //Display Original
-                //imageViewer("original", original1);
-
-                Mat test = original.clone();
-
-
-                //imageViewer("00 Inverse Binarized Original", test);
-
-
-                //************************************
-                //Large Object Removal
-                //************************************
-                Mat srcLOR = original.clone();
-                Mat maskLOR = new Mat();
-                Mat dstLOR = new Mat();
-
-                //denoize
-                Mat denoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
-                Imgproc.morphologyEx(srcLOR,maskLOR, Imgproc.MORPH_OPEN, denoize);
-                //imageViewer("01 Denoize - mask", maskLOR);
-
-                //close up gaps
-                Mat gapCloser = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
-                Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_CLOSE, gapCloser);
-                //imageViewer("02 gap closer - mask", maskLOR);
-
-                //Isolate large items
-                Mat isolateLarge = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(8, 8));
-                Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_OPEN, isolateLarge);
-                //imageViewer("03 Isolate Large - mask", maskLOR);
-
-                //Remove large items from image
-                Core.bitwise_not(maskLOR,maskLOR);
-                srcLOR.copyTo(dstLOR, maskLOR);
-                //imageViewer("04 Large Items Removed", dstLOR);
-
-                //****************************************
-                //Small object removal (SOR)
-                //****************************************
-
-                Mat srcSOR = dstLOR.clone();
-                Mat maskSOR = new Mat();
-                Mat dstSOR = new Mat();
-
-                Mat startSOR =Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
-                Imgproc.morphologyEx(srcSOR,maskSOR, Imgproc.MORPH_OPEN, startSOR);
-                //imageViewer("11 show small - mask", maskSOR);
-
-                Mat highlightSmall = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
-                Imgproc.dilate(maskSOR, maskSOR, highlightSmall);
-                //imageViewer("12 highlight small - mask", maskSOR);
+                System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+                Pair returnVariables = new Pair();
+                int FILLED = -1;
+                try{
+                    //Mat original1 = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+                    //System.out.println("Width: " + original1.width() + " Height: " + original1.height());
+                    //Mat original = original1.clone();
+                    //Imgproc.adaptiveThreshold(original1, original,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, THRESHOLD_C);
+
+                    Mat test = original.clone();
+                    //************************************
+                    //Large Object Removal
+                    //************************************
+                    Mat srcLOR = original.clone();
+                    Mat maskLOR = new Mat();
+                    Mat dstLOR = new Mat();
+
+                    //denoize
+                    Mat denoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
+                    Imgproc.morphologyEx(srcLOR,maskLOR, Imgproc.MORPH_OPEN, denoize);
+
+                    //close up gaps
+                    Mat gapCloser = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
+                    Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_CLOSE, gapCloser);
+
+                    //Isolate large items
+                    Mat isolateLarge = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(8, 8));
+                    Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_OPEN, isolateLarge);
+
+                    //Remove large items from image
+                    Core.bitwise_not(maskLOR,maskLOR);
+                    srcLOR.copyTo(dstLOR, maskLOR);
+
+                    //****************************************
+                    //Small object removal (SOR)
+                    //****************************************
+
+                    Mat srcSOR = dstLOR.clone();
+                    Mat maskSOR = new Mat();
+                    Mat dstSOR = new Mat();
+
+                    Mat startSOR =Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
+                    Imgproc.morphologyEx(srcSOR,maskSOR, Imgproc.MORPH_OPEN, startSOR);
+
+                    Mat highlightSmall = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
+                    Imgproc.dilate(maskSOR, maskSOR, highlightSmall);
+
 
 /*              Mat isolateSmall =Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,10));
@@ -965,166 +1020,155 @@
 */
 
-                //Remove small items from image
-                Core.bitwise_not(maskSOR, maskSOR);
-                srcSOR.copyTo(dstSOR, maskSOR);
-                //imageViewer("14 Small Items Removed", dstSOR);
-
-
-                //****************************************
-                //start staff line detection
-                //****************************************
-
-                Mat kernelErode = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(15,2)); //10,2
-                Imgproc.erode(dstSOR,test,kernelErode);
-                //imageViewer("21 Erode plus pre", test);
-
-                Mat kernelDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //20,3
-                Imgproc.dilate(test,test,kernelDilate);
-                //imageViewer("22 Dilate", test);
-
-                Mat kernelClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
-                Imgproc.morphologyEx(test, test, Imgproc.MORPH_CLOSE, kernelClose);
-                //imageViewer("23 Close", test);
-
-
-                Mat kernelErode02 = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //10,1
-                Imgproc.erode(test,test,kernelErode02);
-                //imageViewer("24 Erode (Final)", test);
-
-                //********************************************************************************
-                //DETECT OUTLINE AND FIND AREA OF THESE LINES.
-                //********************************************************************************
-                ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();
-                ArrayList<MatOfPoint> largeContours = new ArrayList<MatOfPoint>();
-                ArrayList<MatOfPoint> postContours = new ArrayList<MatOfPoint>();
-                Mat hierarchy = new Mat();
-
-                //PARAMETERS: input image, output array of arrays, output array, contour retrieval mode, contour approximation method.
-                //(contours)  output array of arrays: Detected contours. Each contour is stored as a vector of points
-                //(hierarchy) output array:           Optional output vector, containing information about the image topology.
-                //https://docs.opencv.org/3.3.1/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a
-
-                Imgproc.findContours(test, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
-
-                System.out.println(contours.size());
-                //Draw contours and record areas
-                Mat allContoursFound = Mat.zeros(test.size(), CvType.CV_8UC3);
-                Mat largeContoursFound = allContoursFound.clone() ;
-                Mat postContoursFound = allContoursFound.clone();
-                int areaCounter = 0;
-
-                //Have created a preprocess to remove large objects.
-                //Need to now finalized Classifier, re try area detection.
-                //Paths to take - rectangle boxes around detected contours over threshold (area or perimeter)
-                //Just use area and periemter to determine if sheet music
-                //Discuss with david before weekend perhaps?
-
-                Imgproc.drawContours(allContoursFound, contours, -1, new Scalar(0, 255, 0), 1); //USES LINE_8
-                for (int i = 0; i < contours.size(); i++) {
-                    double area = Imgproc.contourArea(contours.get(i));
-                    if(area > 100) {
-                        //System.out.println("AREA: " + area);
-                        Imgproc.drawContours(largeContoursFound, contours, i, new Scalar(255, 0, 0), FILLED);
-                        //create list of large coutours found
-                        largeContours.add(contours.get(i));
-                    }
-                }
-                //imageViewer("80 All Contours found", allContoursFound);
-                //imageViewer("81 Large Contours Found", largeContoursFound);
-
-                //*****************************************************************
-                //Circles and centres on processed images
-                //*****************************************************************
-
-                //Init arrays
-                Mat circleOutput = allContoursFound.clone();
-                MatOfPoint2f[] contoursPoly  = new MatOfPoint2f[largeContours.size()];
-                Point[] centers = new Point[largeContours.size()];
-                float[][] radius = new float[largeContours.size()][1];
-
-                //Fill arrays
-                for (int i = 0; i < largeContours.size(); i++) {
-                    contoursPoly[i] = new MatOfPoint2f();
-                    Imgproc.approxPolyDP(new MatOfPoint2f(largeContours.get(i).toArray()), contoursPoly[i], 1, true);
-                    centers[i] = new Point();
-                    Imgproc.minEnclosingCircle(contoursPoly[i], centers[i], radius[i]);
-
-                }
-                //Draw circle for each large contour
-                for (int i = 0; i < largeContours.size(); i++) {
-                    Imgproc.circle(circleOutput, centers[i], (int) radius[i][0],new Scalar(255, 0, 0), 1);
-                }
-                //imageViewer("82 Circles found", circleOutput);
-
-                //********************************************************************************
-                //Centroids - Everything must be to scale
-                //********************************************************************************
-
-                ArrayList<Moments> mu = new ArrayList<Moments>(largeContours.size());
-                Mat centreOutput = Mat.zeros(largeContoursFound.size(), CvType.CV_8UC3);
-                for (int i = 0; i < largeContours.size(); i++) {
-                    mu.add(i, Imgproc.moments(largeContours.get(i), false));
-                    Moments p = mu.get(i);
-                    int x = (int) (p.get_m10() / p.get_m00());
-                    int y = (int) (p.get_m01() / p.get_m00());
-                    Imgproc.circle(centreOutput, new Point(x, y), 4, new Scalar(255, 255, 255), 30);
-                }
-                //imageViewer("83 Centres found", centreOutput);
-
-
-                //***********************************************
-                //PostProcessing - Morphology Classifier
-                //  Use dilation to "Connect the dots"
-                //  Testing showed the centroids were clustered together
-                //  Then use area or perimeter as a classifier filter
-                //REFINEREFINEREIFEN
-                //REFINEREFINEREIFEN
-                //REFINEREFINEREIFEN
-                //REFINEREFINEREIFEN
-                //REFINEREFINEREIFEN
-                //REFINEREFINEREIFEN
-                //***********************************************
-
-                Mat postDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(150,15));
-                Imgproc.dilate(centreOutput,centreOutput,postDilate);
-                //imageViewer("91 PostDilated", centreOutput);
-
-                Mat postClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
-                Imgproc.morphologyEx(centreOutput, centreOutput, Imgproc.MORPH_CLOSE, postClose);
-                //imageViewer("92 PostClose", centreOutput);
-
-                Mat postDenoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(100,100));
-                Imgproc.morphologyEx(centreOutput,centreOutput, Imgproc.MORPH_OPEN, postDenoize);
-                //imageViewer("93 PostDenoize", centreOutput);
-
-                //Mat postOutline = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(50,50));
-                //Imgproc.morphologyEx(centreOutput, centreOutput, Imgproc.MORPH_GRADIENT, postOutline);
-
-
-
-                //Find area
-                Mat centreOutputGrey = new Mat();
-                Imgproc.cvtColor(centreOutput, centreOutputGrey, Imgproc.COLOR_RGB2GRAY);
-                Imgproc.findContours(centreOutputGrey, postContours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
-
-                for (int i = 0; i < postContours.size(); i++) {
-                    double area = Imgproc.contourArea(postContours.get(i));
-                    if(area > 10000) {
-                        //System.out.println("POST AREA: " + area);
-                        Imgproc.drawContours(postContoursFound, postContours, i, new Scalar(0, 255, 0), FILLED);
-                        areaCounter++;
-                    }
-                }
-                //imageViewer("93 PostEND", postContoursFound);
-
-                //Classifier Calculation
-                if(areaCounter >= THRESHOLD_AREA_COUNT){
-                    //System.out.println("THIS IS SHEET MUSIC");
-                    //System.out.println(areaCounter);
-                }
-
-
+                    //Remove small items from image
+                    Core.bitwise_not(maskSOR, maskSOR);
+                    srcSOR.copyTo(dstSOR, maskSOR);
+
+
+                    //****************************************
+                    //start staff line detection
+                    //****************************************
+
+                    Mat kernelErode = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(15,2)); //10,2
+                    Imgproc.erode(dstSOR,test,kernelErode);
+
+
+                    Mat kernelDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //20,3
+                    Imgproc.dilate(test,test,kernelDilate);
+
+
+                    Mat kernelClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
+                    Imgproc.morphologyEx(test, test, Imgproc.MORPH_CLOSE, kernelClose);
+
+
+
+                    Mat kernelErode02 = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //10,1
+                    Imgproc.erode(test,test,kernelErode02);
+
+
+                    //********************************************************************************
+                    //DETECT OUTLINE AND FIND AREA OF THESE LINES.
+                    //********************************************************************************
+                    ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();
+                    ArrayList<MatOfPoint> largeContours = new ArrayList<MatOfPoint>();
+                    ArrayList<MatOfPoint> postContours = new ArrayList<MatOfPoint>();
+                    Mat hierarchy = new Mat();
+
+                    //PARAMETERS: input image, output array of arrays, output array, contour retrieval mode, contour approximation method.
+                    //(contours)  output array of arrays: Detected contours. Each contour is stored as a vector of points
+                    //(hierarchy) output array:           Optional output vector, containing information about the image topology.
+                    //https://docs.opencv.org/3.3.1/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a
+
+                    Imgproc.findContours(test, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
+
+                    System.out.println(contours.size());
+                    //Draw contours and record areas
+                    Mat allContoursFound = Mat.zeros(test.size(), CvType.CV_8UC3);
+                    Mat largeContoursFound = allContoursFound.clone() ;
+                    Mat postContoursFound = allContoursFound.clone();
+                    int areaCounter = 0;
+
+                    //Have created a preprocess to remove large objects.
+                    //Need to now finalized Classifier, re try area detection.
+                    //Paths to take - rectangle boxes around detected contours over threshold (area or perimeter)
+                    //Just use area and periemter to determine if sheet music
+                    //Discuss with david before weekend perhaps?
+
+                    Imgproc.drawContours(allContoursFound, contours, -1, new Scalar(0, 255, 0), 1); //USES LINE_8
+                    for (int i = 0; i < contours.size(); i++) {
+                        double area = Imgproc.contourArea(contours.get(i));
+                        if(area > 100) {
+                            //System.out.println("AREA: " + area);
+                            Imgproc.drawContours(largeContoursFound, contours, i, new Scalar(255, 0, 0), FILLED);
+                            //create list of large coutours found
+                            largeContours.add(contours.get(i));
+                        }
+                    }
+
+                    //*****************************************************************
+                    //Circles and centres on processed images
+                    //*****************************************************************
+
+                    //Init arrays
+                    Mat circleOutput = allContoursFound.clone();
+                    MatOfPoint2f[] contoursPoly  = new MatOfPoint2f[largeContours.size()];
+                    Point[] centers = new Point[largeContours.size()];
+                    float[][] radius = new float[largeContours.size()][1];
+
+                    //Fill arrays
+                    for (int i = 0; i < largeContours.size(); i++) {
+                        contoursPoly[i] = new MatOfPoint2f();
+                        Imgproc.approxPolyDP(new MatOfPoint2f(largeContours.get(i).toArray()), contoursPoly[i], 1, true);
+                        centers[i] = new Point();
+                        Imgproc.minEnclosingCircle(contoursPoly[i], centers[i], radius[i]);
+
+                    }
+                    //Draw circle for each large contour
+                    for (int i = 0; i < largeContours.size(); i++) {
+                        Imgproc.circle(circleOutput, centers[i], (int) radius[i][0],new Scalar(255, 0, 0), 1);
+                    }
+
+
+                    //********************************************************************************
+                    //Centroids - Everything must be to scale
+                    //********************************************************************************
+
+                    ArrayList<Moments> mu = new ArrayList<Moments>(largeContours.size());
+                    Mat centreOutput = Mat.zeros(largeContoursFound.size(), CvType.CV_8UC3);
+                    for (int i = 0; i < largeContours.size(); i++) {
+                        mu.add(i, Imgproc.moments(largeContours.get(i), false));
+                        Moments p = mu.get(i);
+                        int x = (int) (p.get_m10() / p.get_m00());
+                        int y = (int) (p.get_m01() / p.get_m00());
+                        Imgproc.circle(centreOutput, new Point(x, y), 4, new Scalar(255, 255, 255), 30);
+                    }
+
+                    //***********************************************
+                    //PostProcessing - Morphology Classifier
+                    //  Use dilation to "Connect the dots"
+                    //  Testing showed the centroids were clustered together
+                    //  Then use area or perimeter as a classifier filter
+                    //***********************************************
+
+                    Mat postDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(150,15));
+                    Imgproc.dilate(centreOutput,centreOutput,postDilate);
+
+                    Mat postClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
+                    Imgproc.morphologyEx(centreOutput, centreOutput, Imgproc.MORPH_CLOSE, postClose);
+
+                    Mat postDenoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(100,100));
+                    Imgproc.morphologyEx(centreOutput,centreOutput, Imgproc.MORPH_OPEN, postDenoize);
+
+                    //Find area
+                    Mat centreOutputGrey = new Mat();
+                    Imgproc.cvtColor(centreOutput, centreOutputGrey, Imgproc.COLOR_RGB2GRAY);
+                    Imgproc.findContours(centreOutputGrey, postContours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
+
+                    for (int i = 0; i < postContours.size(); i++) {
+                        double area = Imgproc.contourArea(postContours.get(i));
+                        if(area > THRESHOLD_AREA_SIZE) {
+                            //System.err.println("POST AREA: " + area);
+                            Imgproc.drawContours(postContoursFound, postContours, i, new Scalar(0, 255, 0), FILLED);
+                            areaCounter++;
+                        }
+                    }
+                    //Classifier Calculation
+                    if(areaCounter >= THRESHOLD_AREA_COUNT){
+                        returnVariables.setBoolean(true);
+                        returnVariables.setInteger(areaCounter);
+                    }
+                }
+                catch(Exception e){
+                    System.err.println(e);
+                }
+                //return returnVariables;
             }
 
+            //Reset after david chat
+            if(CODE_VERSION == 9){
+                //1. Remove large items (needs to be larger kernel, should not remove bar lines)
+                //2. Remove text
+                //3. Standard plan from presentation
+                //4. Classify like line clusters.
+            }
             //USE stuc element, to rule out large wide and long pieces of black and white.
 
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile	(revision 33449)
@@ -19,5 +19,5 @@
 
 testrun-classifier-single-cluster:
-	./runClassifer.sh TestImages/test-coo.31924062612282-9.png cluster logSingle.txt -singleNew	
+	./runClassifer.sh TestImages/high-res-test-coo.31924062612282-9.png cluster logSingle.txt -singleNew	
 	echo "Displaying javaImageClassifier output"
         #Calculate the Accuracy of the classifier
@@ -28,5 +28,5 @@
 
 testrun-classifier-single-count:
-	./runClassifer.sh TestImages/test-coo.31924062612282-9.png count logSingle.txt -singleNew
+	./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU/SheetMusic/coo.31924062612282-9.png count logSingle.txt -singleNew
 	echo "Displaying javaImageClassifier output"
         #Calculate the Accuracy of the classifier
@@ -36,5 +36,5 @@
 	
 testrun-classifier-single-combo:
-	./runClassifer.sh TestImages/test-coo.31924062612282-9.png combo logSingle.txt -singleNew
+	./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU/SheetMusic/coo.31924062612282-9.png combo logSingle.txt -singleNew
 	echo "Displaying javaImageClassifier output"
         #Calculate the Accuracy of the classifier
@@ -45,5 +45,7 @@
 testrun-classifier-single-morph:
 	javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaClassifierComparison.java;
-	./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU/SheetMusic/coo.31924062612282-9.png morphology log-all-hires-new/test/logSingle.txt -singleNew
+	./runClassifer.sh TestImages/hi-res-test-coo.31924062612282-9.png morphology log-all-hires-new/test/logSingle.txt -singleNew
+	#./runClassifer.sh TestImages/low-res-test-coo.31924062612282-9.png morphology log-all-hires-new/test/logSingle.txt -singleNew
+	#./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU/SheetMusic/low-res-test-coo.31924062612282-9.png morphology log-all-hires-new/test/logSingle.txt -singleNew
 	echo "Displaying javaImageClassifier output"
         #Calculate the Accuracy of the classifier
@@ -53,2 +55,3 @@
 
 
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java	(revision 33448)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java	(revision 33449)
@@ -182,4 +182,7 @@
                 //Execute classifierType defined from arguement
 
+                File imgCheck = new File(imageFilename);
+                if(!imgCheck.exists()){System.err.println("Image not found: "+ imageFilename);}
+
                 //Split output by tab for processing in next java program
                 //imageFilename = 1, result = 3, classifierType = 4
@@ -201,5 +204,5 @@
                         break;
                     case "morphology":
-                        algorithmResult = Algorithm_MorphologyOLD(imageFilename);
+                        algorithmResult = Algorithm_Morphology(imageFilename);
                         bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + algorithmResult.getBoolean() + '\t' + "Number of areas:" + '\t' + algorithmResult.getInteger() + '\t' + classifierType + '\n');
                         break;
@@ -330,9 +333,10 @@
         Boolean isSheetMusic = null;
         Pair returnVariables = new Pair();
+        int areaCounter = 0;
         try{
-            //Variables
-            int areaCounter = 0;
             Mat edgesDetectedRGB = new Mat();
             Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+
+            System.out.println("Width: " + original.width() + " Height: " + original.height());
 
             ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();
@@ -361,19 +365,17 @@
             for (int i = 0; i < contours.size(); i++) {
                 double area = Imgproc.contourArea(contours.get(i));
+                System.out.println("AREA: " + area);
                 //Check if area detected meets threshold
                 if(area > THRESHOLD_AREA_SIZE) {
                     areaCounter++;
-                    //System.out.println("AREA: " + area);
-                }
-            }
-
-
-
-
-
+
+                }
+            }
+            System.out.println("areacount = " + areaCounter);
 
             //Calculates if sheet music or not
             if(areaCounter >= THRESHOLD_AREA_COUNT){
-                returnVariables.setBoolean(true);
+                isSheetMusic = true;
+                returnVariables.setBoolean(isSheetMusic);
                 returnVariables.setInteger(areaCounter);
             }
@@ -389,13 +391,11 @@
         Boolean isSheetMusic = null;
         Pair returnVariables = new Pair();
+        int FILLED = -1;
         try{
-            int FILLED = -1;
-            //Display Original
-            //imageViewer("original", original1);
-            Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            Mat original1 = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            System.out.println("Width: " + original1.width() + " Height: " + original1.height());
+            Mat original = original1.clone();
+            Imgproc.adaptiveThreshold(original1, original,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, THRESHOLD_C);
             Mat test = original.clone();
-            //imageViewer("00 Inverse Binarized Original", test);
-
-
             //************************************
             //Large Object Removal
@@ -408,20 +408,16 @@
             Mat denoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
             Imgproc.morphologyEx(srcLOR,maskLOR, Imgproc.MORPH_OPEN, denoize);
-            //imageViewer("01 Denoize - mask", maskLOR);
 
             //close up gaps
             Mat gapCloser = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5,5));
             Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_CLOSE, gapCloser);
-            //imageViewer("02 gap closer - mask", maskLOR);
 
             //Isolate large items
             Mat isolateLarge = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(8, 8));
             Imgproc.morphologyEx(maskLOR,maskLOR,Imgproc.MORPH_OPEN, isolateLarge);
-            //imageViewer("03 Isolate Large - mask", maskLOR);
 
             //Remove large items from image
             Core.bitwise_not(maskLOR,maskLOR);
             srcLOR.copyTo(dstLOR, maskLOR);
-            //imageViewer("04 Large Items Removed", dstLOR);
 
             //****************************************
@@ -435,9 +431,8 @@
             Mat startSOR =Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
             Imgproc.morphologyEx(srcSOR,maskSOR, Imgproc.MORPH_OPEN, startSOR);
-            //imageViewer("11 show small - mask", maskSOR);
 
             Mat highlightSmall = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
             Imgproc.dilate(maskSOR, maskSOR, highlightSmall);
-            //imageViewer("12 highlight small - mask", maskSOR);
+
 
 /*              Mat isolateSmall =Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,10));
@@ -449,5 +444,4 @@
             Core.bitwise_not(maskSOR, maskSOR);
             srcSOR.copyTo(dstSOR, maskSOR);
-            //imageViewer("14 Small Items Removed", dstSOR);
 
 
@@ -458,18 +452,18 @@
             Mat kernelErode = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(15,2)); //10,2
             Imgproc.erode(dstSOR,test,kernelErode);
-            //imageViewer("21 Erode plus pre", test);
+
 
             Mat kernelDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //20,3
             Imgproc.dilate(test,test,kernelDilate);
-            //imageViewer("22 Dilate", test);
+
 
             Mat kernelClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
             Imgproc.morphologyEx(test, test, Imgproc.MORPH_CLOSE, kernelClose);
-            //imageViewer("23 Close", test);
+
 
 
             Mat kernelErode02 = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //10,1
             Imgproc.erode(test,test,kernelErode02);
-            //imageViewer("24 Erode (Final)", test);
+
 
             //********************************************************************************
@@ -511,6 +505,4 @@
                 }
             }
-            //imageViewer("80 All Contours found", allContoursFound);
-            //imageViewer("81 Large Contours Found", largeContoursFound);
 
             //*****************************************************************
@@ -536,5 +528,5 @@
                 Imgproc.circle(circleOutput, centers[i], (int) radius[i][0],new Scalar(255, 0, 0), 1);
             }
-            //imageViewer("82 Circles found", circleOutput);
+
 
             //********************************************************************************
@@ -551,6 +543,4 @@
                 Imgproc.circle(centreOutput, new Point(x, y), 4, new Scalar(255, 255, 255), 30);
             }
-            //imageViewer("83 Centres found", centreOutput);
-
 
             //***********************************************
@@ -563,16 +553,10 @@
             Mat postDilate = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(150,15));
             Imgproc.dilate(centreOutput,centreOutput,postDilate);
-            //imageViewer("91 PostDilated", centreOutput);
 
             Mat postClose = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,4)); //4,4
             Imgproc.morphologyEx(centreOutput, centreOutput, Imgproc.MORPH_CLOSE, postClose);
-            //imageViewer("92 PostClose", centreOutput);
 
             Mat postDenoize = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(100,100));
             Imgproc.morphologyEx(centreOutput,centreOutput, Imgproc.MORPH_OPEN, postDenoize);
-            //imageViewer("93 PostDenoize", centreOutput);
-
-            //Mat postOutline = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(50,50));
-            //Imgproc.morphologyEx(centreOutput, centreOutput, Imgproc.MORPH_GRADIENT, postOutline);
 
             //Find area
@@ -584,20 +568,14 @@
                 double area = Imgproc.contourArea(postContours.get(i));
                 if(area > THRESHOLD_AREA_SIZE) {
-                    System.out.println("POST AREA: " + area + "AREA COUNTER: " + areaCounter);
-                    //Imgproc.drawContours(postContoursFound, postContours, i, new Scalar(0, 255, 0), FILLED);
+                    //System.err.println("POST AREA: " + area);
+                    Imgproc.drawContours(postContoursFound, postContours, i, new Scalar(0, 255, 0), FILLED);
                     areaCounter++;
                 }
             }
-
-            //imageViewer("93 PostEND", postContoursFound);
-
-            //Calculates if sheet music or not
+            //Classifier Calculation
             if(areaCounter >= THRESHOLD_AREA_COUNT){
-                returnVariables = new Pair(true, areaCounter);
-                //returnVariables.setBoolean(true);
-                //returnVariables.setInteger(areaCounter);
-                System.out.println("TEST RETURN VARIABLES: "+ returnVariables.toString());
-            }
-
+                returnVariables.setBoolean(true);
+                returnVariables.setInteger(areaCounter);
+            }
         }
         catch(Exception e){
