Changeset 33243
- Timestamp:
- 2019-06-27T15:19:39+12:00 (5 years ago)
- Location:
- other-projects/is-sheet-music-encore/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/is-sheet-music-encore/trunk/Makefile
r33221 r33243 90 90 #HoughLinesP_refined 91 91 run-classifier-houghlinesP-refined-test: 92 #cd image-identification-terminal; rm log-houghlinesP-refined-test.txt 92 93 #Compile 93 94 cd image-identification-terminal; javac javaAccuracyCalculator.java … … 100 101 @date 101 102 #Calculate the Accuracy of the classifier 102 cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-test.txt houghlinesP-refined results.txt103 cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-test.txt houghlinesP-refined-test results.txt 103 104 #Display output of javaImageClassifier 104 105 cd image-identification-terminal; less log-houghlinesP-refined-test.txt … … 107 108 108 109 run-classifier-houghlinesP-refined-all: 110 cd image-identification-terminal; rm log-houghlinesP-refined-MU.txt 109 111 #Compile 110 112 cd image-identification-terminal; javac javaAccuracyCalculator.java … … 113 115 @echo starting classfier 114 116 @date 115 cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP log-houghlinesP-refined-MU.txt -all117 cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP-refined log-houghlinesP-refined-MU.txt -all 116 118 @echo finished classifier 117 119 @date 118 120 #Calculate the Accuracy of the classifier 119 cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-MU.txt houghlinesP results.txt121 cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-MU.txt houghlinesP-refined-all results.txt 120 122 #Display output of javaImageClassifier 121 123 cd image-identification-terminal; less log-houghlinesP-refined-MU.txt … … 145 147 cd image-identification-terminal; less log-houghlinesP-refined-MU.txt 146 148 147 run-classifier-houghlinesP-refined-test-remote:148 #Compile149 cd image-identification-terminal; javac javaAccuracyCalculator.java150 cd image-identification-terminal; javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaImageClassifier.java;151 #Run javaImageClassifier on all images in TestImages152 @echo starting classfier153 @date154 cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/TestImages houghlinesP-refined log-TestImages.txt -all155 @echo finished classifier156 @date157 #Calculate the Accuracy of the classifier158 cd image-identification-terminal; java javaAccuracyCalculator log-TestImages.txt houghlinesP-refined-test results.txt159 #Display output of javaImageClassifier160 cd image-identification-terminal; less log-TestImages.txt161 #Display output of javaAccuracyCalculator output162 cd image-identification-terminal; less results.txt163 cd image-identification-terminal; rm log-TestImages.txt164 -
other-projects/is-sheet-music-encore/trunk/image-identification-development/.idea/workspace.xml
r33170 r33243 20 20 <entry file="file://$PROJECT_DIR$/src/Main.java"> 21 21 <provider selected="true" editor-type-id="text-editor"> 22 <state relative-caret-position=" 337">23 <caret line="1 87" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" />22 <state relative-caret-position="-810"> 23 <caret line="126" column="37" lean-forward="true" selection-start-line="126" selection-start-column="37" selection-end-line="126" selection-end-column="37" /> 24 24 <folding> 25 25 <element signature="imports" expanded="true" /> … … 31 31 </leaf> 32 32 </component> 33 <component name="FindInProjectRecents"> 34 <findStrings> 35 <find>aeu.ark+=13960=t93787r1w-10.png</find> 36 </findStrings> 37 </component> 33 38 <component name="IdeDocumentHistory"> 34 39 <option name="CHANGED_PATHS"> … … 38 43 </option> 39 44 </component> 40 <component name="ProjectFrameBounds" extendedState=" 4">45 <component name="ProjectFrameBounds" extendedState="6"> 41 46 <option name="x" value="992" /> 42 <option name="y" value=" 52" />47 <option name="y" value="24" /> 43 48 <option name="width" value="928" /> 44 <option name="height" value="10 28" />49 <option name="height" value="1056" /> 45 50 </component> 46 51 <component name="ProjectView"> … … 127 132 </component> 128 133 <component name="ToolWindowManager"> 129 <frame x=" 992" y="52" width="928" height="1028" extended-state="4" />134 <frame x="65" y="24" width="1855" height="1056" extended-state="6" /> 130 135 <editor active="true" /> 131 136 <layout> 132 137 <window_info anchor="right" id="Palette" order="4" /> 133 138 <window_info anchor="bottom" id="TODO" order="10" /> 134 <window_info anchor="bottom" id="Messages" order="3" weight="0.32 924336" />139 <window_info anchor="bottom" id="Messages" order="3" weight="0.32842106" /> 135 140 <window_info anchor="right" id="Palette	" order="1" /> 136 141 <window_info id="Image Layers" order="4" /> … … 138 143 <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" /> 139 144 <window_info anchor="right" id="Maven Projects" order="3" /> 140 <window_info active="true" anchor="bottom" id="Run" order="6" visible="true" weight="0.2 2526316" />145 <window_info active="true" anchor="bottom" id="Run" order="6" visible="true" weight="0.21881391" /> 141 146 <window_info anchor="bottom" id="Version Control" order="2" /> 142 147 <window_info anchor="bottom" id="Terminal" order="0" weight="0.42638037" /> … … 148 153 <window_info id="UI Designer" order="1" /> 149 154 <window_info anchor="right" id="Theme Preview" order="2" /> 150 <window_info anchor="bottom" id="Debug" order="7" weight="0.39 97955" />155 <window_info anchor="bottom" id="Debug" order="7" weight="0.39894736" /> 151 156 <window_info id="Favorites" order="3" side_tool="true" /> 152 157 <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" /> … … 162 167 <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" /> 163 168 <window_info anchor="right" id="Capture Analysis" order="0" /> 164 <window_info anchor="bottom" id=" Version Control" order="2" />169 <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" /> 165 170 <window_info anchor="right" id="Theme Preview" order="2" /> 171 <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" /> 166 172 <window_info content_ui="combo" id="Project" order="5" visible="true" weight="0.18382749" /> 167 173 <window_info id="Structure" order="6" side_tool="true" weight="0.25" /> … … 169 175 <window_info anchor="right" id="Ant Build" order="6" weight="0.25" /> 170 176 <window_info anchor="bottom" id="TODO" order="10" /> 171 <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" />172 177 <window_info id="Image Layers" order="4" /> 173 178 <window_info id="Designer" order="0" /> … … 179 184 <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" /> 180 185 <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" /> 181 <window_info anchor="bottom" id=" Cvs" order="8" weight="0.25" />186 <window_info anchor="bottom" id="Version Control" order="2" /> 182 187 <window_info id="Capture Tool" order="2" /> 183 188 <window_info anchor="bottom" id="Message" order="4" /> … … 198 203 <entry file="file://$PROJECT_DIR$/src/Main.java"> 199 204 <provider selected="true" editor-type-id="text-editor"> 205 <state relative-caret-position="645"> 206 <caret line="43" selection-start-line="43" selection-end-line="43" selection-end-column="49" /> 207 <folding> 208 <element signature="imports" expanded="true" /> 209 </folding> 210 </state> 211 </provider> 212 </entry> 213 <entry file="file://$PROJECT_DIR$/src/Main.java"> 214 <provider selected="true" editor-type-id="text-editor"> 215 <state relative-caret-position="585"> 216 <caret line="39" column="47" selection-start-line="39" selection-start-column="47" selection-end-line="39" selection-end-column="47" /> 217 <folding> 218 <element signature="imports" expanded="true" /> 219 </folding> 220 </state> 221 </provider> 222 </entry> 223 <entry file="file://$PROJECT_DIR$/src/Main.java"> 224 <provider selected="true" editor-type-id="text-editor"> 225 <state relative-caret-position="1980"> 226 <caret line="132" selection-start-line="132" selection-end-line="132" /> 227 <folding> 228 <element signature="imports" expanded="true" /> 229 </folding> 230 </state> 231 </provider> 232 </entry> 233 <entry file="file://$PROJECT_DIR$/src/Main.java"> 234 <provider selected="true" editor-type-id="text-editor"> 235 <state relative-caret-position="2805"> 236 <caret line="187" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" /> 237 <folding> 238 <element signature="imports" expanded="true" /> 239 </folding> 240 </state> 241 </provider> 242 </entry> 243 <entry file="file://$PROJECT_DIR$/src/Main.java"> 244 <provider selected="true" editor-type-id="text-editor"> 200 245 <state relative-caret-position="2430"> 201 246 <caret line="162" lean-forward="true" selection-start-line="162" selection-end-line="162" /> … … 375 420 <entry file="file://$PROJECT_DIR$/src/Main.java"> 376 421 <provider selected="true" editor-type-id="text-editor"> 377 <state relative-caret-position=" 337">378 <caret line="1 87" column="68" lean-forward="true" selection-start-line="187" selection-start-column="68" selection-end-line="187" selection-end-column="68" />422 <state relative-caret-position="-810"> 423 <caret line="126" column="37" lean-forward="true" selection-start-line="126" selection-start-column="37" selection-end-line="126" selection-end-column="37" /> 379 424 <folding> 380 425 <element signature="imports" expanded="true" /> -
other-projects/is-sheet-music-encore/trunk/image-identification-development/src/Main.java
r33170 r33243 4 4 import org.opencv.imgcodecs.Imgcodecs; 5 5 import org.opencv.imgproc.Imgproc; 6 import org.opencv.photo.Photo; 6 7 import static org.opencv.imgcodecs.Imgcodecs.imwrite; 7 8 import java.awt.image.BufferedImage; 8 9 import java.awt.image.DataBufferByte; 9 10 import java.io.File; 11 import java.util.ArrayList; 10 12 import javax.imageio.ImageIO; 11 13 … … 37 39 38 40 //GLOBAL_CONSTANTS 41 static int CLASSIFIER_HOUGHLINESP_MIN = 10; 42 static int CLASSIFIER_HOUGHLINESP_MAX = 65; 43 static int HOUGHLINEP_THRESHOLD = 10; 44 static int MINLINECOUNT = 40; 45 static double MAXLINEGAP = 4; 46 static double SLOPEGRADIENT = 0.02; 39 47 //SHOULD TURN INTO ARGS 40 48 … … 59 67 return null; 60 68 } 61 62 private static boolean Classifier(BufferedImage img){ 69 private static boolean ClassifierPixelCount(BufferedImage img){ 63 70 try { 64 71 //Read file … … 85 92 percentage = ((float)redCount/(float)pixelCount)*(float)100; 86 93 //If more than %10 and less than %50 then its sheet music! 87 if(percentage > 10 && percentage < 50){ //MAKE THESE CONSTANTS!!94 if(percentage > CLASSIFIER_HOUGHLINESP_MIN && percentage < CLASSIFIER_HOUGHLINESP_MAX){ //MAKE THESE CONSTANTS!! 88 95 return true;} 89 96 } … … 93 100 return false; 94 101 } 102 private static boolean Classifier(int lineCount){ 103 104 if(lineCount>MINLINECOUNT){ 105 return true; 106 } 107 else{ 108 return false; 109 } 110 } 111 95 112 96 113 public static void main(String[] args) { 97 114 System.loadLibrary(Core.NATIVE_LIBRARY_NAME); 98 115 try { 116 //temp array for terminalversion 117 118 ArrayList returnArray = new ArrayList(); 119 returnArray.add(true); 120 returnArray.add(10); 121 122 99 123 //Variables 100 124 Mat edgesDetected = new Mat(); 101 125 Mat edgesDetectedRGB = new Mat(); 126 Mat edgesExtra = new Mat(); 102 127 Mat edgesDetectedRGBProb; 103 128 Mat edgeDoesntMakeSense; 104 129 Mat justEdges; //TESTING 130 131 String directory = "/Scratch/cpb16/is-sheet-music-encore/download-images/MU/"; 132 //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 133 //mdp.39015097852365-2.png 176 lines Contents page. 134 //mdp.39015097852555-3.png 76 lines 135 String default_file = directory+"SheetMusic/mdp.39015080972303-3.png"; 136 //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png"; 137 138 139 //System.out.println(default_file); 105 140 //String default_file = "TestImages/NotSheetMusic01.png"; 106 String default_file = "TestImages/NotSheetMusic02.png";141 //String default_file = "TestImages/NotSheetMusic02.png"; 107 142 //String default_file = "TestImages/SheetMusic01.png"; 108 143 //String default_file = "TestImages/SheetMusic02.png"; 109 144 //String default_file = "TestImages/vLine.png"; 110 145 String filename = ((args.length > 0) ? args[0] : default_file); 146 File file = new File(filename); 147 if(!file.exists()){System.err.println("Image not found: "+ filename);} 148 149 int horizontalLineCount =0; 111 150 112 151 // Load an image … … 114 153 // Edge detection 115 154 //01 CANNY 116 Imgproc.Canny(original, edgesDetected, 50, 200, 3, false); 155 //Imgproc.Canny(original, edgesDetected, 50, 200, 3, false); 156 //Imgproc.Canny(original, edgesDetected,0, 100, 3, false ); 117 157 //Imgproc.Canny(original, edgesDetected,80, 120); 118 158 //02 BINARYINV 119 //Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2); 159 Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2); 160 161 //Imgproc.adaptiveThreshold(original, edgesExtra,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2); 162 //Imgproc.medianBlur(edgesExtra, edgesDetected, 3); 120 163 //03 BINARY 121 164 //Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY,15, 2); … … 127 170 128 171 172 173 129 174 //Convert to RGB for future use 130 175 Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR); … … 136 181 //(edgeDetectedImage, outputOfDetection(r,Ξ), resolution of rho, resolution of theta, threshold (minimum num of intersections) 137 182 138 double minLineLength = edgesDetectedRGB.size().width/4; 139 Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 50, minLineLength, 10); // runs the actual detection 140 141 183 double minLineLength = edgesDetectedRGB.size().width/8; 184 185 Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength,MAXLINEGAP); // runs the actual detection 186 //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, HOUGHLINEP_THRESHOLD, minLineLength,MAXLINEGAP); // runs the actual detection 187 System.out.println("Before Graident Filtering num lines: " + linesP.rows()); 142 188 143 189 //Imgproc.HoughLinesP(edgesDetected,linesP,1,Math.PI/2, 50, 80, 5); … … 170 216 171 217 172 173 174 175 176 if(m<=0.1) { 218 if(m<=SLOPEGRADIENT) { 177 219 //System.out.println("m: " + m); 178 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); 220 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); 221 horizontalLineCount++; 179 222 } 180 223 … … 189 232 190 233 BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB); 191 System.out.println("Result: " + Classifier(toBeClassifiedImg)); 192 234 System.out.println("Result: " + Classifier(horizontalLineCount)); 235 236 237 System.out.println(); 193 238 //Display Results 194 //HighGui.imshow("Source", original);239 HighGui.imshow("Source", original); 195 240 //HighGui.imshow("Just Edges", justEdges); //TESTING 196 241 HighGui.imshow("Detected Lines (in red) - positive", edgesDetectedRGB); -
other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java
r33221 r33243 12 12 import javax.imageio.ImageIO; 13 13 import java.util.logging.Logger; 14 import java.util.ArrayList; 14 15 15 16 //REFERENCES: … … 28 29 public class javaImageClassifier{ 29 30 //Constants 30 static int CLASSIFIER_HOUGHLINESP_MIN = 5; 31 static int CLASSIFIER_HOUGHLINESP_MAX = 40; 31 32 static int CLASSIFIER_HOUGHLINESP_MIN = 10; 33 static int CLASSIFIER_HOUGHLINESP_MAX = 65; 34 static int HOUGHLINEP_THRESHOLD = 10; 35 static int MINLINECOUNT = 40; //50 36 static double MAXLINEGAP = 4; 37 static double SLOPEGRADIENT = 0.02; //0.01 32 38 33 39 public static void main(String[] args) { … … 37 43 } 38 44 else { 45 ArrayList result_refined = null; 39 46 Boolean result = null; 40 47 String imageFilename = args[0]; 41 48 String classifierType = args[1]; 42 String outputFilename = args[2]; 49 String outputFilename = args[2]; 50 //Prep Writing output to disc 51 File log = new File(outputFilename); 52 FileWriter fileWriter = new FileWriter(log, true); 53 BufferedWriter bw = new BufferedWriter(fileWriter); 43 54 //Execute classifierType defined from arguement 55 56 //Split output by tab for processing in next java program 57 //imageFilename = 1, result = 3, classifierType = 4 44 58 switch(classifierType){ 45 59 case "houghlinesP": 46 60 result = setup_HoughLinesP(imageFilename); //true or false 61 bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + result + '\t' + classifierType + '\n'); 47 62 break; 48 63 case "houghlinesP-refined": 49 result = setup_HoughLinesP_refined(imageFilename); 64 result_refined = setup_HoughLinesP_refined(imageFilename); 65 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'); 50 66 break; 51 67 default: … … 53 69 break; 54 70 } 55 //Write output to disc 56 File log = new File(outputFilename); 57 FileWriter fileWriter = new FileWriter(log, true); 58 BufferedWriter bw = new BufferedWriter(fileWriter); 59 //Split output by tab for processing in next java program 60 //imageFilename = 1, result = 3, classifierType = 4 61 bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + result + '\t' + classifierType + '\n'); 71 62 72 bw.close(); 63 73 } … … 81 91 Mat edgesDetected = new Mat(); 82 92 Mat edgesDetectedRGB = new Mat(); 93 Mat edgesExtra = new Mat(); 83 94 Mat edgesDetectedRGBProb; 84 95 // Load an image … … 108 119 } 109 120 110 private static Booleansetup_HoughLinesP_refined(String filename){121 private static ArrayList setup_HoughLinesP_refined(String filename){ 111 122 System.loadLibrary(Core.NATIVE_LIBRARY_NAME); 112 123 Boolean isSheetMusic = null; 124 ArrayList returnArray = new ArrayList(); 113 125 try{ 126 114 127 //Variables 128 int horizontalLineCount =0; 115 129 Mat edgesDetected = new Mat(); 116 130 Mat edgesDetectedRGB = new Mat(); 131 Mat edgesExtra = new Mat(); 117 132 Mat edgesDetectedRGBProb; 118 133 // Load an image 119 134 Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE); 120 135 // Edge detection 121 Imgproc.Canny(original, edgesDetected, 50, 200, 3, false); 136 //Imgproc.Canny(original, edgesDetected, 50, 200, 3, false); 137 Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2); 138 //Imgproc.medianBlur(edgesExtra, edgesDetected, 3); 139 140 122 141 //Copy edges to the images that will display the results in BGR 123 142 Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR); 124 143 // Probabilistic Line Transform 125 144 Mat linesP = new Mat(); // will hold the results of the detection 126 double minLineLength = edgesDetectedRGB.size().width/ 4;127 //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 50, minLineLength, 10);// runs the actual detection128 Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 10, minLineLength, 5);// remote testing145 double minLineLength = edgesDetectedRGB.size().width/8; 146 //Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 10, minLineLength, MAXLINEGAP);// runs the actual detection 147 Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength, MAXLINEGAP); //TESTING 129 148 // Draw the lines 130 149 … … 139 158 //System.out.println(l[2]); 140 159 //System.out.println(l[3]); 141 if(m< 0.1) {160 if(m<SLOPEGRADIENT) { 142 161 //System.out.println("m: " + m); 143 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); 162 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); 163 horizontalLineCount++; 144 164 } 145 165 } … … 148 168 BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB); 149 169 //Calculate if its sheet music or not 150 isSheetMusic = classifier_HoughLinesP(toBeClassifiedImg); 151 170 isSheetMusic = classifier_HoughLinesP_refined(horizontalLineCount); 171 returnArray.add(isSheetMusic); 172 returnArray.add(horizontalLineCount); 152 173 153 174 } … … 155 176 System.err.println(e); 156 177 } 157 return isSheetMusic;178 return returnArray; 158 179 } 159 180 … … 193 214 return false; 194 215 } 216 217 private static boolean classifier_HoughLinesP_refined(int lineCount){ 218 if(lineCount>MINLINECOUNT){ 219 return true; 220 } 221 else{ 222 return false; 223 } 224 } 225 195 226 private static BufferedImage toBufferedImage(Mat mat){ 196 227 //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -
other-projects/is-sheet-music-encore/trunk/image-identification-terminal/results.txt
r33221 r33243 22 22 23 23 24 Date: Sun Jun 23 17:48:16 NZST 2019 24 BEST SO FAR 25 Date: Tue Jun 25 16:02:11 NZST 2019 26 Classifier: houghlinesP-refined 27 truePositive: 80 28 falseNegative: 20 29 falsePositve: 11 30 trueNegative: 89 31 SheetMusicAccuracyRate: 80.0% 32 NotSheetMusicAccuracyRate: 89.0% 33 OverallAccuracyRate: 84.5% 34 35 Date: Tue Jun 25 16:21:55 NZST 2019 36 Classifier: houghlinesP 37 truePositive: 3063 38 falseNegative: 98 39 falsePositve: 596 40 trueNegative: 1244 41 SheetMusicAccuracyRate: 96.89972% 42 NotSheetMusicAccuracyRate: 67.608696% 43 OverallAccuracyRate: 86.12277% 44 45 Date: Tue Jun 25 20:06:21 NZST 2019 46 Classifier: houghlinesP-refined-all 47 truePositive: 1723 48 falseNegative: 1438 49 falsePositve: 86 50 trueNegative: 1754 51 SheetMusicAccuracyRate: 54.508064% 52 NotSheetMusicAccuracyRate: 95.32609% 53 OverallAccuracyRate: 69.52609% 54 55 Date: Tue Jun 25 20:13:22 NZST 2019 56 Classifier: houghlinesP-refined 57 truePositive: 80 58 falseNegative: 20 59 falsePositve: 11 60 trueNegative: 89 61 SheetMusicAccuracyRate: 80.0% 62 NotSheetMusicAccuracyRate: 89.0% 63 OverallAccuracyRate: 84.5% 64 65 Date: Tue Jun 25 22:40:22 NZST 2019 66 Classifier: houghlinesP-refined-all-canny 67 truePositive: 1124 68 falseNegative: 2037 69 falsePositve: 61 70 trueNegative: 1779 71 SheetMusicAccuracyRate: 35.558365% 72 NotSheetMusicAccuracyRate: 96.684784% 73 OverallAccuracyRate: 58.048393% 74 75 MAX 65 76 MIN 10 77 ALL MU 78 RESULT: 79 80 81 Date: Wed Jun 26 20:08:09 NZST 2019 82 Classifier: houghlinesP-refined-all-canny 83 truePositive: 1124 84 falseNegative: 2037 85 falsePositve: 61 86 trueNegative: 1779 87 SheetMusicAccuracyRate: 35.558365% 88 NotSheetMusicAccuracyRate: 96.684784% 89 OverallAccuracyRate: 58.048393% 90 91 Date: Wed Jun 26 20:44:04 NZST 2019 92 Classifier: houghlinesP-refined-all 93 truePositive: 1725 94 falseNegative: 1436 95 falsePositve: 87 96 trueNegative: 1753 97 SheetMusicAccuracyRate: 54.571335% 98 NotSheetMusicAccuracyRate: 95.271736% 99 OverallAccuracyRate: 69.54609% 100 101 BOTH PRE THURSDAY MEETING 102 Date: Wed Jun 26 21:40:37 NZST 2019 103 Classifier: houghlinesP 104 truePositive: 3103 105 falseNegative: 58 106 falsePositve: 660 107 trueNegative: 1180 108 SheetMusicAccuracyRate: 98.16514% 109 NotSheetMusicAccuracyRate: 64.13044% 110 OverallAccuracyRate: 85.642876% 111 112 Date: Wed Jun 26 21:40:37 NZST 2019 113 Classifier: houghlinesP-refined 114 truePositive: 1725 115 falseNegative: 1436 116 falsePositve: 87 117 trueNegative: 1753 118 SheetMusicAccuracyRate: 54.571335% 119 NotSheetMusicAccuracyRate: 95.271736% 120 OverallAccuracyRate: 69.54609% 121 122 123 POST MEETING 124 125 126 Date: Thu Jun 27 11:56:02 NZST 2019 127 Classifier: houghlinesP-refined 128 truePositive: 0 129 falseNegative: 0 130 falsePositve: 0 131 trueNegative: 0 132 SheetMusicAccuracyRate: 0.0% 133 NotSheetMusicAccuracyRate: 0.0% 134 OverallAccuracyRate: 0.0% 135 136 Date: Thu Jun 27 12:04:40 NZST 2019 25 137 Classifier: houghlinesP-refined-test 26 truePositive: 527 falseNegative: 528 falsePositve: 029 trueNegative: 1030 SheetMusicAccuracyRate: 50.0%31 NotSheetMusicAccuracyRate: 100.0%32 OverallAccuracyRate: 75.0%138 truePositive: 7 139 falseNegative: 3 140 falsePositve: 5 141 trueNegative: 5 142 SheetMusicAccuracyRate: 70.0% 143 NotSheetMusicAccuracyRate: 50.0% 144 OverallAccuracyRate: 60.000004% 33 145 34 Date: Sun Jun 23 17:50:39 NZST 2019 35 Classifier: houghlinesP-refined-test 36 truePositive: 5 37 falseNegative: 5 38 falsePositve: 0 39 trueNegative: 10 40 SheetMusicAccuracyRate: 50.0% 41 NotSheetMusicAccuracyRate: 100.0% 42 OverallAccuracyRate: 75.0% 146 LINE GAP OF 10 43 147 148 Date: Thu Jun 27 12:24:59 NZST 2019 149 Classifier: houghlinesP-refined-all 150 truePositive: 2808 151 falseNegative: 353 152 falsePositve: 307 153 trueNegative: 1533 154 SheetMusicAccuracyRate: 88.83265% 155 NotSheetMusicAccuracyRate: 83.315216% 156 OverallAccuracyRate: 86.802635% 157 158 159 LINE GAP OF 4 160 161 162 Date: Thu Jun 27 14:35:24 NZST 2019 163 Classifier: houghlinesP-refined-all 164 truePositive: 2626 165 falseNegative: 535 166 falsePositve: 77 167 trueNegative: 1763 168 SheetMusicAccuracyRate: 83.074974% 169 NotSheetMusicAccuracyRate: 95.815216% 170 OverallAccuracyRate: 87.76244% 171 172 MINLINECOUNT=40 173 gradient = 0.02 174 Date: Thu Jun 27 15:10:14 NZST 2019 175 Classifier: houghlinesP-refined-all 176 truePositive: 2961 177 falseNegative: 200 178 falsePositve: 136 179 trueNegative: 1704 180 SheetMusicAccuracyRate: 93.67289% 181 NotSheetMusicAccuracyRate: 92.608696% 182 OverallAccuracyRate: 93.28135% 183 -
other-projects/is-sheet-music-encore/trunk/image-identification-terminal/runClassifer.sh
r33221 r33243 2 2 3 3 if [ $# != 4 ] ; then 4 echo "Usage: ./testClassifier.sh file_name classifier_type output_filename num_doc(-a = all -test =100)" 1>&24 echo "Usage: ./testClassifier.sh file_name classifier_type output_filename type(-a:all -test:100)" 1>&2 5 5 exit 1 6 6 fi … … 8 8 folder_name=$1 9 9 classifier_type=$2 10 output_filename=$3 11 num_doc=$4 10 output=$3 12 11 i=0 12 j=0 13 13 case "$4" in 14 14 -all) … … 16 16 for file_name in $folder_name/*/*.png; do 17 17 echo $file_name 18 echo $output _filename18 echo $output 19 19 echo $i 20 20 echo "" 21 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 _filename21 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 22 22 i=$[$i+1] 23 23 done 24 ;; 24 ;; 25 25 26 -test) 26 #Runs javaImageClassifier on 100 images 27 for file_name in $folder_name/*/*.png; do 28 if [ $i -lt 200 ] ; then 29 echo $file_name 30 echo $output_filename 31 echo $i 32 echo "" 33 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 34 i=$[$i+1] 35 else 36 exit 0 37 fi 27 #Runs javaImageClassifier on 100 images of each 28 for file_name in $folder_name/SheetMusic/*.png; do 29 if [ $i -lt 10 ] ; then 30 echo $file_name 31 echo $output 32 echo $i 33 echo "" 34 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 35 i=$[$i+1] 36 fi 38 37 done 39 ;; 40 -small) 41 #Runs javaImageClassifier on 100 images 42 for file_name in $folder_name/*/*.png; do 43 if [ $i -lt 50 ] ; then 44 echo $file_name 45 echo $output_filename 46 echo $i 47 echo "" 48 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 49 i=$[$i+1] 50 else 51 exit 0 52 fi 38 for file_name in $folder_name/NotSheetMusic/*.png; do 39 if [ $j -lt 10 ] ; then 40 echo $file_name 41 echo $output 42 echo $j 43 echo "" 44 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 45 j=$[$j+1] 46 fi 53 47 done 54 ;; 48 ;; 49 55 50 esac
Note:
See TracChangeset
for help on using the changeset viewer.