Ignore:
Timestamp:
2019-05-16T11:15:02+12:00 (5 years ago)
Author:
cpb16
Message:

added notes from meeting

File:
1 edited

Legend:

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

    r33070 r33082  
    1616//https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
    1717
     18
     19
     20//GOAL for 21st
     21
     22
     23//Classifier 01
     24//Have args so can call "java image-identification-classifier01 XX XX"
     25//args can be parameters in algorthim such as threshold or theta?
     26//Run on 5000 images.
     27//Record success rates
     28//All done with makefile
     29
     30
     31//But first understand houghline transform
     32//Know what the algorithm being used is doing.
     33//MAke constants for this classifier
     34//Make java be able to run on CMD line
    1835
    1936public class Main {
     
    6582            percentage = ((float)redCount/(float)pixelCount)*(float)100;
    6683            //If more than %10 and less than %50 then its sheet music!
    67             if(percentage > 10 && percentage < 50){
     84            if(percentage > 10 && percentage < 50){ //MAKE THESE CONSTANTS!!
    6885                return true;}
    6986        }
     
    99116            Imgproc.HoughLines(edgesDetected, lines, 1, Math.PI / 180, 150); // runs the actual detection
    100117            // Draw the lines
     118            //LOOK OVER THIS AGAIN THE 1000 might be image height?
     119            //THRESHOLD should be changed, based on img dimensions?
     120
    101121            for (int x = 0; x < lines.rows(); x++) {
    102122                double rho = lines.get(x, 0)[0],
    103123                        theta = lines.get(x, 0)[1];
     124                //CONVERT to Cartisean coord
    104125                double a = Math.cos(theta), b = Math.sin(theta);
    105126                double x0 = a * rho, y0 = b * rho;
     127
    106128                Point pt1 = new Point(Math.round(x0 + 1000 * (-b)), Math.round(y0 + 1000 * (a)));
    107129                Point pt2 = new Point(Math.round(x0 - 1000 * (-b)), Math.round(y0 - 1000 * (a)));
Note: See TracChangeset for help on using the changeset viewer.