Changeset 33082
- Timestamp:
- 2019-05-16T11:15:02+12:00 (5 years ago)
- Location:
- other-projects/is-sheet-music-encore/trunk/image-identification
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/is-sheet-music-encore/trunk/image-identification/.idea/workspace.xml
r33070 r33082 3 3 <component name="ChangeListManager"> 4 4 <list default="true" readonly="true" id="9bad4f92-4a7d-46a2-b6f0-94214c9f55cc" name="Default" comment=""> 5 <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> 6 <change beforePath="$PROJECT_DIR$/out/production/image-identification/Main.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/image-identification/Main.class" afterDir="false" /> 5 7 <change beforePath="$PROJECT_DIR$/src/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" /> 6 8 </list> … … 18 20 <entry file="file://$PROJECT_DIR$/src/Main.java"> 19 21 <provider selected="true" editor-type-id="text-editor"> 20 <state relative-caret-position=" 107">21 <caret line=" 19" lean-forward="true" selection-start-line="19" selection-end-line="19" />22 <state relative-caret-position="495"> 23 <caret line="33" column="38" selection-start-line="33" selection-start-column="38" selection-end-line="33" selection-end-column="38" /> 22 24 <folding> 23 25 <element signature="imports" expanded="true" /> … … 49 51 </component> 50 52 <component name="PropertiesComponent"> 53 <property name="GenerateAntBuildDialog.backupFiles" value="true" /> 54 <property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" /> 55 <property name="GenerateAntBuildDialog.forceTargetJdk" value="true" /> 56 <property name="GenerateAntBuildDialog.generateSingleFile" value="true" /> 57 <property name="GenerateAntBuildDialog.outputFileNameProperty" value="image-identification" /> 51 58 <property name="full.screen.before.presentation.mode" value="false" /> 52 59 <property name="last_opened_file_path" value="$USER_HOME$/Desktop" /> 53 <property name="project.structure.last.edited" value=" Project" />60 <property name="project.structure.last.edited" value="Modules" /> 54 61 <property name="project.structure.proportion" value="0.15" /> 55 62 <property name="project.structure.side.proportion" value="0.2" /> … … 130 137 <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" /> 131 138 <window_info anchor="right" id="Maven Projects" order="3" /> 132 <window_info anchor="bottom" id="Run" order="6" weight="0. 34662578" />139 <window_info anchor="bottom" id="Run" order="6" weight="0.26993865" /> 133 140 <window_info anchor="bottom" id="Version Control" order="2" /> 134 141 <window_info anchor="bottom" id="Terminal" order="0" weight="0.42638037" /> … … 154 161 <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" /> 155 162 <window_info anchor="right" id="Capture Analysis" order="0" /> 156 <window_info anchor="bottom" id=" Run" order="6" visible="true" weight="0.34662578" />163 <window_info anchor="bottom" id="Version Control" order="2" /> 157 164 <window_info anchor="right" id="Theme Preview" order="2" /> 158 165 <window_info content_ui="combo" id="Project" order="5" visible="true" weight="0.18382749" /> … … 161 168 <window_info anchor="right" id="Ant Build" order="6" weight="0.25" /> 162 169 <window_info anchor="bottom" id="TODO" order="10" /> 163 <window_info anchor="bottom" id=" Version Control" order="2" />170 <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" /> 164 171 <window_info id="Image Layers" order="4" /> 165 172 <window_info id="Designer" order="0" /> … … 190 197 <entry file="file://$PROJECT_DIR$/src/Main.java"> 191 198 <provider selected="true" editor-type-id="text-editor"> 199 <state relative-caret-position="285"> 200 <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" /> 201 <folding> 202 <element signature="imports" expanded="true" /> 203 </folding> 204 </state> 205 </provider> 206 </entry> 207 <entry file="file://$PROJECT_DIR$/src/Main.java"> 208 <provider selected="true" editor-type-id="text-editor"> 192 209 <state relative-caret-position="1410"> 193 210 <caret line="94" column="73" selection-start-line="94" selection-start-column="73" selection-end-line="94" selection-end-column="73" /> … … 237 254 <entry file="file://$PROJECT_DIR$/src/Main.java"> 238 255 <provider selected="true" editor-type-id="text-editor"> 239 <state relative-caret-position=" 107">240 <caret line=" 19" lean-forward="true" selection-start-line="19" selection-end-line="19" />256 <state relative-caret-position="495"> 257 <caret line="33" column="38" selection-start-line="33" selection-start-column="38" selection-end-line="33" selection-end-column="38" /> 241 258 <folding> 242 259 <element signature="imports" expanded="true" /> -
other-projects/is-sheet-music-encore/trunk/image-identification/src/Main.java
r33070 r33082 16 16 //https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object 17 17 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 18 35 19 36 public class Main { … … 65 82 percentage = ((float)redCount/(float)pixelCount)*(float)100; 66 83 //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!! 68 85 return true;} 69 86 } … … 99 116 Imgproc.HoughLines(edgesDetected, lines, 1, Math.PI / 180, 150); // runs the actual detection 100 117 // Draw the lines 118 //LOOK OVER THIS AGAIN THE 1000 might be image height? 119 //THRESHOLD should be changed, based on img dimensions? 120 101 121 for (int x = 0; x < lines.rows(); x++) { 102 122 double rho = lines.get(x, 0)[0], 103 123 theta = lines.get(x, 0)[1]; 124 //CONVERT to Cartisean coord 104 125 double a = Math.cos(theta), b = Math.sin(theta); 105 126 double x0 = a * rho, y0 = b * rho; 127 106 128 Point pt1 = new Point(Math.round(x0 + 1000 * (-b)), Math.round(y0 + 1000 * (a))); 107 129 Point pt2 = new Point(Math.round(x0 - 1000 * (-b)), Math.round(y0 - 1000 * (a)));
Note:
See TracChangeset
for help on using the changeset viewer.