Index: /other-projects/is-sheet-music-encore/trunk/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33243)
@@ -90,4 +90,5 @@
 #HoughLinesP_refined
 run-classifier-houghlinesP-refined-test:
+	#cd image-identification-terminal; rm log-houghlinesP-refined-test.txt
         #Compile
 	cd image-identification-terminal; javac javaAccuracyCalculator.java
@@ -100,5 +101,5 @@
 	@date
         #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-test.txt houghlinesP-refined results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-test.txt houghlinesP-refined-test results.txt
         #Display output of javaImageClassifier
 	cd image-identification-terminal; less log-houghlinesP-refined-test.txt
@@ -107,4 +108,5 @@
 
 run-classifier-houghlinesP-refined-all:
+	cd image-identification-terminal; rm log-houghlinesP-refined-MU.txt
         #Compile
 	cd image-identification-terminal; javac javaAccuracyCalculator.java
@@ -113,9 +115,9 @@
 	@echo starting classfier
 	@date
-	cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP log-houghlinesP-refined-MU.txt -all
+	cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP-refined log-houghlinesP-refined-MU.txt -all
 	@echo finished classifier
 	@date
         #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-MU.txt houghlinesP results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-MU.txt houghlinesP-refined-all results.txt
         #Display output of javaImageClassifier
 	cd image-identification-terminal; less log-houghlinesP-refined-MU.txt
@@ -145,20 +147,2 @@
 	cd image-identification-terminal; less log-houghlinesP-refined-MU.txt
 
-run-classifier-houghlinesP-refined-test-remote:
-        #Compile
-	cd image-identification-terminal; javac javaAccuracyCalculator.java
-	cd image-identification-terminal; javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaImageClassifier.java;
-        #Run javaImageClassifier on all images in TestImages
-	@echo starting classfier
-	@date
-	cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/TestImages houghlinesP-refined log-TestImages.txt -all
-	@echo finished classifier
-	@date
-        #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-TestImages.txt houghlinesP-refined-test results.txt
-        #Display output of javaImageClassifier
-	cd image-identification-terminal; less log-TestImages.txt
-        #Display output of javaAccuracyCalculator output
-	cd image-identification-terminal; less results.txt
-	cd image-identification-terminal; rm log-TestImages.txt
-
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-development/.idea/workspace.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-development/.idea/workspace.xml	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-development/.idea/workspace.xml	(revision 33243)
@@ -20,6 +20,6 @@
         <entry file="file://$PROJECT_DIR$/src/Main.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="337">
-              <caret line="187" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" />
+            <state relative-caret-position="-810">
+              <caret line="126" column="37" lean-forward="true" selection-start-line="126" selection-start-column="37" selection-end-line="126" selection-end-column="37" />
               <folding>
                 <element signature="imports" expanded="true" />
@@ -31,4 +31,9 @@
     </leaf>
   </component>
+  <component name="FindInProjectRecents">
+    <findStrings>
+      <find>aeu.ark+=13960=t93787r1w-10.png</find>
+    </findStrings>
+  </component>
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
@@ -38,9 +43,9 @@
     </option>
   </component>
-  <component name="ProjectFrameBounds" extendedState="4">
+  <component name="ProjectFrameBounds" extendedState="6">
     <option name="x" value="992" />
-    <option name="y" value="52" />
+    <option name="y" value="24" />
     <option name="width" value="928" />
-    <option name="height" value="1028" />
+    <option name="height" value="1056" />
   </component>
   <component name="ProjectView">
@@ -127,10 +132,10 @@
   </component>
   <component name="ToolWindowManager">
-    <frame x="992" y="52" width="928" height="1028" extended-state="4" />
+    <frame x="65" y="24" width="1855" height="1056" extended-state="6" />
     <editor active="true" />
     <layout>
       <window_info anchor="right" id="Palette" order="4" />
       <window_info anchor="bottom" id="TODO" order="10" />
-      <window_info anchor="bottom" id="Messages" order="3" weight="0.32924336" />
+      <window_info anchor="bottom" id="Messages" order="3" weight="0.32842106" />
       <window_info anchor="right" id="Palette&#9;" order="1" />
       <window_info id="Image Layers" order="4" />
@@ -138,5 +143,5 @@
       <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
       <window_info anchor="right" id="Maven Projects" order="3" />
-      <window_info active="true" anchor="bottom" id="Run" order="6" visible="true" weight="0.22526316" />
+      <window_info active="true" anchor="bottom" id="Run" order="6" visible="true" weight="0.21881391" />
       <window_info anchor="bottom" id="Version Control" order="2" />
       <window_info anchor="bottom" id="Terminal" order="0" weight="0.42638037" />
@@ -148,5 +153,5 @@
       <window_info id="UI Designer" order="1" />
       <window_info anchor="right" id="Theme Preview" order="2" />
-      <window_info anchor="bottom" id="Debug" order="7" weight="0.3997955" />
+      <window_info anchor="bottom" id="Debug" order="7" weight="0.39894736" />
       <window_info id="Favorites" order="3" side_tool="true" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" />
@@ -162,6 +167,7 @@
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" />
       <window_info anchor="right" id="Capture Analysis" order="0" />
-      <window_info anchor="bottom" id="Version Control" order="2" />
+      <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" />
       <window_info anchor="right" id="Theme Preview" order="2" />
+      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
       <window_info content_ui="combo" id="Project" order="5" visible="true" weight="0.18382749" />
       <window_info id="Structure" order="6" side_tool="true" weight="0.25" />
@@ -169,5 +175,4 @@
       <window_info anchor="right" id="Ant Build" order="6" weight="0.25" />
       <window_info anchor="bottom" id="TODO" order="10" />
-      <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" />
       <window_info id="Image Layers" order="4" />
       <window_info id="Designer" order="0" />
@@ -179,5 +184,5 @@
       <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
       <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
-      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
+      <window_info anchor="bottom" id="Version Control" order="2" />
       <window_info id="Capture Tool" order="2" />
       <window_info anchor="bottom" id="Message" order="4" />
@@ -198,4 +203,44 @@
     <entry file="file://$PROJECT_DIR$/src/Main.java">
       <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="645">
+          <caret line="43" selection-start-line="43" selection-end-line="43" selection-end-column="49" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="585">
+          <caret line="39" column="47" selection-start-line="39" selection-start-column="47" selection-end-line="39" selection-end-column="47" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1980">
+          <caret line="132" selection-start-line="132" selection-end-line="132" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="2805">
+          <caret line="187" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" />
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="2430">
           <caret line="162" lean-forward="true" selection-start-line="162" selection-end-line="162" />
@@ -375,6 +420,6 @@
     <entry file="file://$PROJECT_DIR$/src/Main.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="337">
-          <caret line="187" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" />
+        <state relative-caret-position="-810">
+          <caret line="126" column="37" lean-forward="true" selection-start-line="126" selection-start-column="37" selection-end-line="126" selection-end-column="37" />
           <folding>
             <element signature="imports" expanded="true" />
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-development/src/Main.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-development/src/Main.java	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-development/src/Main.java	(revision 33243)
@@ -4,8 +4,10 @@
 import org.opencv.imgcodecs.Imgcodecs;
 import org.opencv.imgproc.Imgproc;
+import org.opencv.photo.Photo;
 import static org.opencv.imgcodecs.Imgcodecs.imwrite;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferByte;
 import java.io.File;
+import java.util.ArrayList;
 import javax.imageio.ImageIO;
 
@@ -37,4 +39,10 @@
 
     //GLOBAL_CONSTANTS
+    static int CLASSIFIER_HOUGHLINESP_MIN 	= 10;
+    static int CLASSIFIER_HOUGHLINESP_MAX 	= 65;
+    static int HOUGHLINEP_THRESHOLD			= 10;
+    static int MINLINECOUNT                 = 40;
+    static double MAXLINEGAP              	= 4;
+    static double SLOPEGRADIENT			  	= 0.02;
     //SHOULD TURN INTO ARGS
 
@@ -59,6 +67,5 @@
         return null;
     }
-
-    private static boolean Classifier(BufferedImage img){
+    private static boolean ClassifierPixelCount(BufferedImage img){
         try {
             //Read file
@@ -85,5 +92,5 @@
             percentage = ((float)redCount/(float)pixelCount)*(float)100;
             //If more than %10 and less than %50 then its sheet music!
-            if(percentage > 10 && percentage < 50){ //MAKE THESE CONSTANTS!!
+            if(percentage > CLASSIFIER_HOUGHLINESP_MIN && percentage < CLASSIFIER_HOUGHLINESP_MAX){ //MAKE THESE CONSTANTS!!
                 return true;}
         }
@@ -93,20 +100,52 @@
         return false;
     }
+    private static boolean Classifier(int lineCount){
+
+           if(lineCount>MINLINECOUNT){
+                return true;
+            }
+            else{
+                return false;
+            }
+    }
+
 
     public static void main(String[] args) {
         System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
         try {
+            //temp array for terminalversion
+
+            ArrayList returnArray = new ArrayList();
+            returnArray.add(true);
+            returnArray.add(10);
+
+
             //Variables
             Mat edgesDetected = new Mat();
             Mat edgesDetectedRGB = new Mat();
+            Mat edgesExtra = new Mat();
             Mat edgesDetectedRGBProb;
             Mat edgeDoesntMakeSense;
             Mat justEdges; //TESTING
+
+            String directory = "/Scratch/cpb16/is-sheet-music-encore/download-images/MU/";
+            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //mdp.39015097852365-2.png 176 lines    Contents page.
+            //mdp.39015097852555-3.png 76  lines
+            String default_file = directory+"SheetMusic/mdp.39015080972303-3.png";
+            //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
+
+
+            //System.out.println(default_file);
             //String default_file = "TestImages/NotSheetMusic01.png";
-            String default_file = "TestImages/NotSheetMusic02.png";
+            //String default_file = "TestImages/NotSheetMusic02.png";
             //String default_file = "TestImages/SheetMusic01.png";
             //String default_file = "TestImages/SheetMusic02.png";
             //String default_file = "TestImages/vLine.png";
             String filename = ((args.length > 0) ? args[0] : default_file);
+            File file = new File(filename);
+            if(!file.exists()){System.err.println("Image not found: "+ filename);}
+
+            int horizontalLineCount =0;
 
             // Load an image
@@ -114,8 +153,12 @@
             // Edge detection
             //01 CANNY
-            Imgproc.Canny(original, edgesDetected, 50, 200, 3, false);
+            //Imgproc.Canny(original, edgesDetected, 50, 200, 3, false);
+            //Imgproc.Canny(original, edgesDetected,0, 100, 3, false );
             //Imgproc.Canny(original, edgesDetected,80, 120);
             //02 BINARYINV
-            //Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2);
+            Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2);
+
+            //Imgproc.adaptiveThreshold(original, edgesExtra,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2);
+            //Imgproc.medianBlur(edgesExtra, edgesDetected, 3);
             //03 BINARY
             //Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY,15, 2);
@@ -127,4 +170,6 @@
 
 
+
+
             //Convert to RGB for future use
             Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR);
@@ -136,8 +181,9 @@
             //(edgeDetectedImage, outputOfDetection(r,Îž), resolution of rho, resolution of theta, threshold (minimum num of intersections)
 
-            double minLineLength = edgesDetectedRGB.size().width/4;
-            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 50, minLineLength, 10); // runs the actual detection
-
-
+            double minLineLength = edgesDetectedRGB.size().width/8;
+
+            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength,MAXLINEGAP); // runs the actual detection
+            //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, HOUGHLINEP_THRESHOLD, minLineLength,MAXLINEGAP); // runs the actual detection
+            System.out.println("Before Graident Filtering num lines: " + linesP.rows());
 
             //Imgproc.HoughLinesP(edgesDetected,linesP,1,Math.PI/2, 50, 80, 5);
@@ -170,11 +216,8 @@
 
 
-
-
-
-
-                if(m<=0.1) {
+                if(m<=SLOPEGRADIENT) {
                     //System.out.println("m: " + m);
-                    Imgproc.line(edgesDetectedRGB, new Point(l[0], l[1]), new Point(l[2], l[3]), new Scalar(0, 0, 255), 3, Imgproc.LINE_AA, 0);
+                    Imgproc.line(edgesDetectedRGB, new Point(l[0], l[1]), new Point(l[2], l[3]), new Scalar(0, 0, 255), 1, Imgproc.LINE_AA, 0);
+                    horizontalLineCount++;
                 }
 
@@ -189,8 +232,10 @@
 
             BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB);
-            System.out.println("Result: " + Classifier(toBeClassifiedImg));
-
+            System.out.println("Result: " + Classifier(horizontalLineCount));
+
+
+            System.out.println();
             //Display Results
-            //HighGui.imshow("Source", original);
+            HighGui.imshow("Source", original);
             //HighGui.imshow("Just Edges", justEdges); //TESTING
             HighGui.imshow("Detected Lines (in red) - positive", edgesDetectedRGB);
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java	(revision 33243)
@@ -12,4 +12,5 @@
 import javax.imageio.ImageIO;
 import java.util.logging.Logger;
+import java.util.ArrayList;
 
 //REFERENCES:
@@ -28,6 +29,11 @@
 public class javaImageClassifier{
 	//Constants
-	static int CLASSIFIER_HOUGHLINESP_MIN = 5;
-	static int CLASSIFIER_HOUGHLINESP_MAX = 40;
+
+	static int CLASSIFIER_HOUGHLINESP_MIN 	= 10;
+	static int CLASSIFIER_HOUGHLINESP_MAX 	= 65;
+	static int HOUGHLINEP_THRESHOLD			= 10;
+	static int MINLINECOUNT                 = 40; //50
+	static double MAXLINEGAP              	= 4;
+	static double SLOPEGRADIENT			  	= 0.02; //0.01
 
     public static void main(String[] args) {  	
@@ -37,15 +43,25 @@
 			}
 			else {
+				ArrayList result_refined = null;
 				Boolean result = null;
 				String imageFilename = args[0];
 				String classifierType = args[1];
-				String outputFilename = args[2];			
+				String outputFilename = args[2];
+				//Prep Writing output to disc
+				File log = new File(outputFilename);
+				FileWriter fileWriter = new FileWriter(log, true);
+				BufferedWriter bw = new BufferedWriter(fileWriter);			
 				//Execute classifierType defined from arguement
+				
+				//Split output by tab for processing in next java program
+				//imageFilename = 1, result = 3, classifierType = 4
 				switch(classifierType){
 				case "houghlinesP":
 					result = setup_HoughLinesP(imageFilename); //true or false
+					bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + result + '\t' + classifierType + '\n');
 					break;
 				case "houghlinesP-refined":
-					result = setup_HoughLinesP_refined(imageFilename);
+					result_refined = setup_HoughLinesP_refined(imageFilename);
+					bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + result_refined.get(0) + '\t' + "Number of lines:" + '\t' + result_refined.get(1) + '\t' + classifierType + '\n');
 					break;
 				default:
@@ -53,11 +69,5 @@
 					break;
 				}			
-				//Write output to disc
-				File log = new File(outputFilename);
-				FileWriter fileWriter = new FileWriter(log, true);
-				BufferedWriter bw = new BufferedWriter(fileWriter);
-				//Split output by tab for processing in next java program
-				//imageFilename = 1, result = 3, classifierType = 4
-    			bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + result + '\t' + classifierType + '\n');
+
 				bw.close();				
 			}
@@ -81,4 +91,5 @@
 	    Mat edgesDetected = new Mat();
 	    Mat edgesDetectedRGB = new Mat();
+	    Mat edgesExtra = new Mat();
 	    Mat edgesDetectedRGBProb;
 	    // Load an image
@@ -108,23 +119,31 @@
  }
  
-     private static Boolean setup_HoughLinesP_refined(String filename){
+     private static ArrayList setup_HoughLinesP_refined(String filename){
 	System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
 	Boolean isSheetMusic = null;
+	ArrayList returnArray = new ArrayList();
 	try{
+	 	
 	    //Variables
+	    int horizontalLineCount =0;
 	    Mat edgesDetected = new Mat();
 	    Mat edgesDetectedRGB = new Mat();
+	    Mat edgesExtra = new Mat();
 	    Mat edgesDetectedRGBProb;
 	    // Load an image
 	    Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
 	    // Edge detection
-	    Imgproc.Canny(original, edgesDetected, 50, 200, 3, false);
+	    //Imgproc.Canny(original, edgesDetected, 50, 200, 3, false);
+	    Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2);
+        //Imgproc.medianBlur(edgesExtra, edgesDetected, 3);
+        
+	    
 	    //Copy edges to the images that will display the results in BGR
 	    Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR);
 	    // Probabilistic Line Transform
 	    Mat linesP = new Mat(); // will hold the results of the detection
-	    double minLineLength = edgesDetectedRGB.size().width/4;
-	    //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 50, minLineLength, 10);// runs the actual detection
-            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 10, minLineLength, 5);// remote testing
+	    double minLineLength = edgesDetectedRGB.size().width/8;
+	    //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 10, minLineLength, MAXLINEGAP);// runs the actual detection
+        Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength, MAXLINEGAP); //TESTING
 	    // Draw the lines
 	    
@@ -139,7 +158,8 @@
             //System.out.println(l[2]);
             //System.out.println(l[3]);
-            if(m<0.1) {
+            if(m<SLOPEGRADIENT) {
             	//System.out.println("m: " + m);
-            	Imgproc.line(edgesDetectedRGB, new Point(l[0], l[1]), new Point(l[2], l[3]), new Scalar(0, 0, 255), 3, Imgproc.LINE_AA, 0);
+            	Imgproc.line(edgesDetectedRGB, new Point(l[0], l[1]), new Point(l[2], l[3]), new Scalar(0, 0, 255), 1, Imgproc.LINE_AA, 0);
+            	horizontalLineCount++;
             }
 	    }
@@ -148,6 +168,7 @@
 	    BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB);
 	    //Calculate if its sheet music or not
-	    isSheetMusic = classifier_HoughLinesP(toBeClassifiedImg);  
-
+	    isSheetMusic = classifier_HoughLinesP_refined(horizontalLineCount);  
+		returnArray.add(isSheetMusic);
+		returnArray.add(horizontalLineCount);
    		    
 	}
@@ -155,5 +176,5 @@
             System.err.println(e);
         }
-        return isSheetMusic;
+        return returnArray;
  }
  
@@ -193,4 +214,14 @@
         return false;
     }
+    
+    private static boolean classifier_HoughLinesP_refined(int lineCount){
+    	if(lineCount>MINLINECOUNT){
+        	return true;
+        }
+        else{
+        	return false;
+    	}
+    }
+    
         private static  BufferedImage toBufferedImage(Mat mat){
         //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/results.txt
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/results.txt	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/results.txt	(revision 33243)
@@ -22,22 +22,162 @@
 
 
-Date: Sun Jun 23 17:48:16 NZST 2019
+BEST SO FAR
+Date: Tue Jun 25 16:02:11 NZST 2019
+Classifier: houghlinesP-refined
+truePositive: 80
+falseNegative: 20
+falsePositve: 11
+trueNegative: 89
+SheetMusicAccuracyRate: 80.0%
+NotSheetMusicAccuracyRate: 89.0%
+OverallAccuracyRate: 84.5%
+
+Date: Tue Jun 25 16:21:55 NZST 2019
+Classifier: houghlinesP
+truePositive: 3063
+falseNegative: 98
+falsePositve: 596
+trueNegative: 1244
+SheetMusicAccuracyRate: 96.89972%
+NotSheetMusicAccuracyRate: 67.608696%
+OverallAccuracyRate: 86.12277%
+
+Date: Tue Jun 25 20:06:21 NZST 2019
+Classifier: houghlinesP-refined-all
+truePositive: 1723
+falseNegative: 1438
+falsePositve: 86
+trueNegative: 1754
+SheetMusicAccuracyRate: 54.508064%
+NotSheetMusicAccuracyRate: 95.32609%
+OverallAccuracyRate: 69.52609%
+
+Date: Tue Jun 25 20:13:22 NZST 2019
+Classifier: houghlinesP-refined
+truePositive: 80
+falseNegative: 20
+falsePositve: 11
+trueNegative: 89
+SheetMusicAccuracyRate: 80.0%
+NotSheetMusicAccuracyRate: 89.0%
+OverallAccuracyRate: 84.5%
+
+Date: Tue Jun 25 22:40:22 NZST 2019
+Classifier: houghlinesP-refined-all-canny
+truePositive: 1124
+falseNegative: 2037
+falsePositve: 61
+trueNegative: 1779
+SheetMusicAccuracyRate: 35.558365%
+NotSheetMusicAccuracyRate: 96.684784%
+OverallAccuracyRate: 58.048393%
+
+MAX 65
+MIN 10
+ALL MU
+RESULT:
+
+
+Date: Wed Jun 26 20:08:09 NZST 2019
+Classifier: houghlinesP-refined-all-canny
+truePositive: 1124
+falseNegative: 2037
+falsePositve: 61
+trueNegative: 1779
+SheetMusicAccuracyRate: 35.558365%
+NotSheetMusicAccuracyRate: 96.684784%
+OverallAccuracyRate: 58.048393%
+
+Date: Wed Jun 26 20:44:04 NZST 2019
+Classifier: houghlinesP-refined-all
+truePositive: 1725
+falseNegative: 1436
+falsePositve: 87
+trueNegative: 1753
+SheetMusicAccuracyRate: 54.571335%
+NotSheetMusicAccuracyRate: 95.271736%
+OverallAccuracyRate: 69.54609%
+
+BOTH PRE THURSDAY MEETING
+Date: Wed Jun 26 21:40:37 NZST 2019
+Classifier: houghlinesP
+truePositive: 3103
+falseNegative: 58
+falsePositve: 660
+trueNegative: 1180
+SheetMusicAccuracyRate: 98.16514%
+NotSheetMusicAccuracyRate: 64.13044%
+OverallAccuracyRate: 85.642876%
+
+Date: Wed Jun 26 21:40:37 NZST 2019
+Classifier: houghlinesP-refined
+truePositive: 1725
+falseNegative: 1436
+falsePositve: 87
+trueNegative: 1753
+SheetMusicAccuracyRate: 54.571335%
+NotSheetMusicAccuracyRate: 95.271736%
+OverallAccuracyRate: 69.54609%
+
+
+POST MEETING 
+
+
+Date: Thu Jun 27 11:56:02 NZST 2019
+Classifier: houghlinesP-refined
+truePositive: 0
+falseNegative: 0
+falsePositve: 0
+trueNegative: 0
+SheetMusicAccuracyRate: 0.0%
+NotSheetMusicAccuracyRate: 0.0%
+OverallAccuracyRate: 0.0%
+
+Date: Thu Jun 27 12:04:40 NZST 2019
 Classifier: houghlinesP-refined-test
-truePositive: 5
-falseNegative: 5
-falsePositve: 0
-trueNegative: 10
-SheetMusicAccuracyRate: 50.0%
-NotSheetMusicAccuracyRate: 100.0%
-OverallAccuracyRate: 75.0%
+truePositive: 7
+falseNegative: 3
+falsePositve: 5
+trueNegative: 5
+SheetMusicAccuracyRate: 70.0%
+NotSheetMusicAccuracyRate: 50.0%
+OverallAccuracyRate: 60.000004%
 
-Date: Sun Jun 23 17:50:39 NZST 2019
-Classifier: houghlinesP-refined-test
-truePositive: 5
-falseNegative: 5
-falsePositve: 0
-trueNegative: 10
-SheetMusicAccuracyRate: 50.0%
-NotSheetMusicAccuracyRate: 100.0%
-OverallAccuracyRate: 75.0%
+LINE GAP OF 10
 
+Date: Thu Jun 27 12:24:59 NZST 2019
+Classifier: houghlinesP-refined-all
+truePositive: 2808
+falseNegative: 353
+falsePositve: 307
+trueNegative: 1533
+SheetMusicAccuracyRate: 88.83265%
+NotSheetMusicAccuracyRate: 83.315216%
+OverallAccuracyRate: 86.802635%
+
+
+LINE GAP OF 4
+
+
+Date: Thu Jun 27 14:35:24 NZST 2019
+Classifier: houghlinesP-refined-all
+truePositive: 2626
+falseNegative: 535
+falsePositve: 77
+trueNegative: 1763
+SheetMusicAccuracyRate: 83.074974%
+NotSheetMusicAccuracyRate: 95.815216%
+OverallAccuracyRate: 87.76244%
+
+MINLINECOUNT=40
+gradient = 0.02
+Date: Thu Jun 27 15:10:14 NZST 2019
+Classifier: houghlinesP-refined-all
+truePositive: 2961
+falseNegative: 200
+falsePositve: 136
+trueNegative: 1704
+SheetMusicAccuracyRate: 93.67289%
+NotSheetMusicAccuracyRate: 92.608696%
+OverallAccuracyRate: 93.28135%
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/runClassifer.sh
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/runClassifer.sh	(revision 33242)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/runClassifer.sh	(revision 33243)
@@ -2,5 +2,5 @@
 
 if [ $# != 4 ] ; then 
-  echo "Usage: ./testClassifier.sh file_name classifier_type output_filename num_doc(-a = all -test = 100)" 1>&2
+  echo "Usage: ./testClassifier.sh file_name classifier_type output_filename type(-a:all -test:100)" 1>&2
   exit 1
 fi
@@ -8,7 +8,7 @@
 folder_name=$1
 classifier_type=$2
-output_filename=$3
-num_doc=$4
+output=$3
 i=0
+j=0
 case "$4" in
 	-all)
@@ -16,40 +16,35 @@
 		for file_name in $folder_name/*/*.png; do
 			echo $file_name
-			echo $output_filename
+			echo $output
 			echo $i
 			echo ""
-			java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output_filename
+			java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output
 			i=$[$i+1]
 		done
-		;;
+	;;
+		
 	-test)
-		#Runs javaImageClassifier on 100 images
-		for file_name in $folder_name/*/*.png; do
-		if [ $i -lt 200 ] ; then
-			echo $file_name
-			echo $output_filename
-			echo $i
-			echo ""
-			java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output_filename
-			i=$[$i+1]
-		else
-			exit 0
-		fi		
+		#Runs javaImageClassifier on 100 images of each
+		for file_name in $folder_name/SheetMusic/*.png; do
+			if [ $i -lt 10 ] ; then
+				echo $file_name
+				echo $output
+				echo $i
+				echo ""
+				java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output
+				i=$[$i+1]		
+			fi
 		done
-		;;
-	-small)
-		#Runs javaImageClassifier on 100 images
-		for file_name in $folder_name/*/*.png; do
-		if [ $i -lt 50 ] ; then
-			echo $file_name
-			echo $output_filename
-			echo $i
-			echo ""
-			java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output_filename
-			i=$[$i+1]
-		else
-			exit 0
-		fi		
+		for file_name in $folder_name/NotSheetMusic/*.png; do
+			if [ $j -lt 10 ] ; then
+				echo $file_name
+				echo $output
+				echo $j
+				echo ""
+				java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaImageClassifier $file_name $classifier_type $output
+				j=$[$j+1]		
+			fi
 		done
-		;;
+	;;
+			
 esac		
