Changeset 33304 for other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java
- Timestamp:
- 2019-07-06T15:45:02+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java
r33243 r33304 33 33 static int CLASSIFIER_HOUGHLINESP_MAX = 65; 34 34 static int HOUGHLINEP_THRESHOLD = 10; 35 static int MINLINECOUNT = 40; //5035 static int MINLINECOUNT = 40; 36 36 static double MAXLINEGAP = 4; 37 static double SLOPEGRADIENT = 0.02; //0.0137 static double SLOPEGRADIENT = 0.02; 38 38 39 39 public static void main(String[] args) { … … 136 136 //Imgproc.Canny(original, edgesDetected, 50, 200, 3, false); 137 137 Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, 2); 138 //Imgproc.blur(edgesExtra, edgesDetected, new Size(3,1)); 138 139 //Imgproc.medianBlur(edgesExtra, edgesDetected, 3); 139 140 … … 160 161 if(m<SLOPEGRADIENT) { 161 162 //System.out.println("m: " + m); 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 //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); SINCE NOT SAVING IMAGES OR COUNTING PIXELS 163 164 horizontalLineCount++; 164 165 } … … 166 167 167 168 //Convert MAT into a BufferedImage 168 BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB);169 //BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB); SINCE NOT SAVING IMAGES OR COUNTING PIXELS 169 170 //Calculate if its sheet music or not 170 171 isSheetMusic = classifier_HoughLinesP_refined(horizontalLineCount);
Note:
See TracChangeset
for help on using the changeset viewer.