Index: /other-projects/is-sheet-music-encore/trunk/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33414)
+++ /other-projects/is-sheet-music-encore/trunk/Makefile	(revision 33415)
@@ -4,5 +4,5 @@
 
 
-single:
+download-single:
 	./COMPX520-RUN-PNG.sh coo1.ark:/13960/t2t448j81 1
 
@@ -11,11 +11,6 @@
 #HI-RES
 #**********
+
 hi-res-download-all:
-	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/gen-50-MU-hathiValidIDList.txt MU
-	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/gen-50-BK-hathiValidIDList.txt BK
-	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/gen-50-SE-hathiValidIDList.txt SE
-	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/gen-50-MP-hathiValidIDList.txt MP
-
-hi-res-download-reconstructed:
 	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/MU-500-reconstructed.txt MU
 	./COMPX520-DOWNLOADER-PNG-10PAGES-hi-res.sh java-gen-corpus/BK-500-reconstructed.txt BK
@@ -27,13 +22,4 @@
 #Prior to running the scripts below
 ######################################
-#Run all DOWNLOAD
-#NNEEDDD TOO FIIX
-gen-500-all:
-	make gen-500-MU
-	make gen-500-BK
-	make gen-500-SE
-	make gen-500-MP
-	make gen-500-MX
-
 #MUSIC, Including Sheet music
 gen-500-MU:
@@ -75,103 +61,67 @@
 	./COMPX520-DOWNLOADER-PNG-10PAGES.sh java-gen-corpus/gen-500-MX-hathiValidIDList.txt
 
-
 #***********
 #CLASSIFIERS
 #***********
-
-#HoughLinesP
-run-classifier-houghlinesP-test:
-        #Compile
+run-cluster-single-test:
+	cd image-identification-terminal; make testrun-classifier-single-cluster
+	
+run-count-single-test:
+	cd image-identification-terminal; make testrun-classifier-single-count
+	
+run-cluster-corpus-hires:
+	#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/MU houghlinesP log-houghlinesP-test.txt -test
-	@echo finished classifier
-	@date
-        #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-test.txt houghlinesP results.txt
-        #Display output of javaImageClassifier
-	cd image-identification-terminal; less log-houghlinesP-test.txt
-        #Display output of javaAccuracyCalculator
-	cd image-identification-terminal; less results.txt
-
-run-classifier-houghlinesP-all:
-        #Compile
+	#Run classifier
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU cluster log-all-hires-new/log-cluster-MU.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/BK cluster log-all-hires-new/log-cluster-BK.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MP cluster log-all-hires-new/log-cluster-MP.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/SE cluster log-all-hires-new/log-cluster-SE.txt -allNew
+	#Calculate accuracy
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-cluster-MU.txt cluster-MU log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-cluster-BK.txt cluster-BK log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-cluster-MP.txt cluster-MP log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-cluster-SE.txt cluster-SE log-all-hires-new/results.txt
+    #Display the results
+	cd image-identification-terminal; less log-all-hires-new/results.txt 
+	
+run-count-corpus-hires:
+	#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 MU
-	@echo starting classfier
-	@date
-	cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP log-houghlinesP-MU.txt -all
-	@echo finished classifier
-	@date
-        #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-MU.txt houghlinesP results.txt
-        #Display output of javaImageClassifier
-	cd image-identification-terminal; less log-houghlinesP-MU.txt
-        #Display output of javaAccuracyCalculator
-	cd image-identification-terminal; less results.txt
+	#Run classifier
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU count log-all-hires-new/log-count-MU.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/BK count log-all-hires-new/log-count-BK.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MP count log-all-hires-new/log-count-MP.txt -allNew
+	cd image-identification-terminal; /runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/SE count log-all-hires-new/log-count-SE.txt -allNew
+	#Calculate accuracy
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-count-MU.txt count-MU log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-count-BK.txt count-BK log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-count-MP.txt count-MP log-all-hires-new/results.txt
+	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires-new/log-count-SE.txt count-SE log-all-hires-new/results.txt
+    #Display the results
+	cd image-identification-terminal; less log-all-hires-new/results.txt 	
+	
+	
 
-#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
-	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/MU houghlinesP-refined log-houghlinesP-refined-test.txt -test
-	@echo finished classifier
-	@date
-        #Calculate the Accuracy of the classifier
-	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
-        #Display output of javaAccuracyCalculator output
-	cd image-identification-terminal; less results.txt
 
-run-classifier-houghlinesP-refined-all:
-	cd image-identification-terminal; rm log-houghlinesP-refined-MU.txt
-        #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 MU
-	@echo starting classfier
-	@date
-	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-refined-all results.txt
-        #Display output of javaImageClassifier
-	cd image-identification-terminal; less log-houghlinesP-refined-MU.txt
-        #Display output of javaAccuracyCalculator
-	cd image-identification-terminal; less results.txt
 
-run-both-MU:
-        #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 MU
-	@echo starting houghlinesP classfier
-	@date
-	cd image-identification-terminal; ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/download-images/MU houghlinesP log-houghlinesP-MU.txt -all
-	@echo finished houghlinesP classifier
-	@date
-	@echo starting houghlinesP-refined classfier
-	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 houghlinesP-refined classifier
-	@date
-        #Calculate the Accuracy of the classifier
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-MU.txt houghlinesP results.txt
-	cd image-identification-terminal; java javaAccuracyCalculator log-houghlinesP-refined-MU.txt houghlinesP-refined results.txt
-        #Display the results
-	cd image-identification-terminal; less results.txt
-	cd image-identification-terminal; less log-houghlinesP-MU.txt
-	cd image-identification-terminal; less log-houghlinesP-refined-MU.txt
 
+
+
+
+
+
+
+
+
+
+
+
+
+#***********
+#OLDCLASSIFIERS
+#***********
 run-houghlinesP-refined-corpus:
 	#cd image-identification-terminal; cd log-all; rm *.txt
@@ -194,5 +144,5 @@
 run-houghlinesP-refined-corpus-hi-res:
 	cd image-identification-terminal; cd log-all-hires; rm *.txt
-        #Compile
+    #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;
@@ -208,4 +158,3 @@
 	cd image-identification-terminal; java javaAccuracyCalculator log-all-hires/log-houghlinesP-refined-SE.txt houghlinesP-refined-SE log-all-hires/results.txt
         #Display the results
-	cd image-identification-terminal; less log-all-hires/results.txt
-
+	cd image-identification-terminal; less log-all-hires/results.txt	
Index: /other-projects/is-sheet-music-encore/trunk/SETUP.bash
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/SETUP.bash	(revision 33414)
+++ /other-projects/is-sheet-music-encore/trunk/SETUP.bash	(revision 33415)
@@ -39,3 +39,2 @@
 # CONFIG_ARGS=$( cat <<_EOF_ | tr '\n' ' ' INC=-I/usr/local/opt/openssl/include LDDLFLAGS="-bundle -undefined dynamic_lookup -fstack-protector-strong -L/usr/local/opt/openssl/lib" LD="env MACOSX_DEPLOYMENT_TARGET=10.11 cc" LDFLAGS="-fstack-protector-strong -L/usr/local/opt/openssl/lib" _EOF_ ) cpanm Net::SSLeay --configure-args "$CONFIG_ARGS" --interactive --verbose 
 
-
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/encodings.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/encodings.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/encodings.xml	(revision 33415)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/misc.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/misc.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/misc.xml	(revision 33415)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/modules.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/modules.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/modules.xml	(revision 33415)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/image-identification-dev-02.iml" filepath="$PROJECT_DIR$/image-identification-dev-02.iml" />
+    </modules>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/.idea/workspace.xml	(revision 33415)
@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="2a802599-8889-4aa5-9351-0a495d9acc5c" name="Default Changelist" comment="" />
+    <ignored path="$PROJECT_DIR$/out/" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/image-identification-development/src/Main.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="2394">
+              <caret line="780" selection-start-line="780" selection-end-line="780" />
+              <folding>
+                <element signature="imports" expanded="true" />
+                <element signature="class#StartAndEndPoint#0;class#Main#0" />
+                <element signature="method#removeDuplicates#0;class#Main#0" />
+                <element signature="method#StandardDeviation#0;class#Main#0" />
+                <element signature="method#VarianceCalc#0;class#Main#0" />
+                <element signature="method#lineComparison#0;class#Main#0" />
+                <element signature="method#ClusterCheck#0;class#Main#0" />
+                <element signature="method#toBufferedImage#0;class#Main#0" />
+                <element signature="method#ClassifierPixelCount#0;class#Main#0" />
+                <element signature="method#ClassifierLineCount#0;class#Main#0" />
+                <element signature="method#ClassifierLineClusterOLD#0;class#Main#0" />
+                <element signature="method#ClassifierLineCluster#0;class#Main#0" />
+                <element signature="method#ClassifierLineClusterPt#0;class#Main#0" />
+                <element signature="method#LineCountOrCluster#0;class#Main#0" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/image-identification-development/src/MainMorph.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="340">
+              <caret line="275" lean-forward="true" selection-start-line="275" selection-end-line="275" />
+              <folding>
+                <element signature="class#StartAndEndPoint#0;class#MainMor#0" />
+                <element signature="method#toBufferedImage#0;class#MainMor#0" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FindInProjectRecents">
+    <findStrings>
+      <find>pointArrayList</find>
+      <find>clustersFoundRGB</find>
+      <find>ClassifierLineClusterPt</find>
+      <find>Object</find>
+    </findStrings>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java" />
+        <option value="$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison" />
+        <option value="$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison.java" />
+        <option value="$PROJECT_DIR$/image-identification-development/src/Main.java" />
+        <option value="$PROJECT_DIR$/image-identification-development/src/MainMorph.java" />
+      </list>
+    </option>
+  </component>
+  <component name="MavenProjectNavigator">
+    <treeState>
+      <expand />
+      <select />
+    </treeState>
+  </component>
+  <component name="ProjectFrameBounds" extendedState="6">
+    <option name="x" value="511" />
+    <option name="y" value="214" />
+    <option name="width" value="918" />
+    <option name="height" value="767" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes />
+  </component>
+  <component name="PropertiesComponent">
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison.java" />
+    <property name="project.structure.last.edited" value="SDKs" />
+    <property name="project.structure.proportion" value="0.15" />
+    <property name="project.structure.side.proportion" value="0.2" />
+    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager">
+    <configuration name="MainMorph" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="MainMorph" />
+      <module name="image-identification-dev-02" />
+      <option name="VM_PARAMETERS" value="-Djava.library.path=$PROJECT_DIR$/../../opencv-3.4.2/build/lib " />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Application.MainMorph" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="2a802599-8889-4aa5-9351-0a495d9acc5c" name="Default Changelist" comment="" />
+      <created>1564877113082</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1564877113082</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="67" y="25" width="1613" height="1025" extended-state="6" />
+    <layout>
+      <window_info content_ui="combo" id="Project" order="0" weight="0.19783024" />
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+      <window_info id="Designer" order="2" />
+      <window_info id="UI Designer" order="3" />
+      <window_info id="Favorites" order="4" side_tool="true" />
+      <window_info anchor="bottom" id="Message" order="0" />
+      <window_info anchor="bottom" id="Find" order="1" />
+      <window_info anchor="bottom" id="Run" order="2" weight="0.24610245" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="Version Control" order="7" />
+      <window_info anchor="bottom" id="Terminal" order="8" weight="0.32962137" />
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" weight="0.32962137" />
+      <window_info anchor="bottom" id="Messages" order="10" weight="0.32962137" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
+      <window_info anchor="right" id="Palette" order="3" />
+      <window_info anchor="right" id="Palette&#9;" order="4" />
+      <window_info anchor="right" id="Maven" order="5" weight="0.3299298" />
+    </layout>
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison" />
+    <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="345">
+          <caret line="77" column="42" selection-start-line="77" selection-start-column="42" selection-end-line="77" selection-end-column="42" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="e#1743#2305#0" />
+            <element signature="e#4073#5568#0" />
+            <element signature="e#5573#6811#0" />
+            <element signature="e#6817#9109#0" />
+            <element signature="e#9114#9310#0" />
+            <element signature="e#9312#9371#0" />
+            <element signature="e#10174#11092#0" />
+            <element signature="e#11097#18874#0" />
+            <element signature="e#18879#21582#0" />
+            <element signature="e#21587#22251#0" />
+            <element signature="e#22256#22628#0" />
+            <element signature="e#22633#23394#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaClassifierComparison.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="921">
+          <caret line="107" column="5" lean-forward="true" selection-start-line="107" selection-start-column="5" selection-end-line="107" selection-end-column="5" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="class#StartAndEndPoint#0;class#javaClassifierComparison#0" />
+            <element signature="method#StartAndEndPoint#0;class#StartAndEndPoint#0;class#javaClassifierComparison#0" />
+            <element signature="class#Pair#0;class#javaClassifierComparison#0" />
+            <element signature="method#Classifier_LineCounter#0;class#javaClassifierComparison#0" />
+            <element signature="method#VarianceCalc#0;class#javaClassifierComparison#0" />
+            <element signature="method#lineComparison#0;class#javaClassifierComparison#0" />
+            <element signature="method#ClusterCheck#0;class#javaClassifierComparison#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/image-identification-development/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="2394">
+          <caret line="780" selection-start-line="780" selection-end-line="780" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="class#StartAndEndPoint#0;class#Main#0" />
+            <element signature="method#removeDuplicates#0;class#Main#0" />
+            <element signature="method#StandardDeviation#0;class#Main#0" />
+            <element signature="method#VarianceCalc#0;class#Main#0" />
+            <element signature="method#lineComparison#0;class#Main#0" />
+            <element signature="method#ClusterCheck#0;class#Main#0" />
+            <element signature="method#toBufferedImage#0;class#Main#0" />
+            <element signature="method#ClassifierPixelCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterOLD#0;class#Main#0" />
+            <element signature="method#ClassifierLineCluster#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterPt#0;class#Main#0" />
+            <element signature="method#LineCountOrCluster#0;class#Main#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/image-identification-development/src/MainMorph.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="340">
+          <caret line="275" lean-forward="true" selection-start-line="275" selection-end-line="275" />
+          <folding>
+            <element signature="class#StartAndEndPoint#0;class#MainMor#0" />
+            <element signature="method#toBufferedImage#0;class#MainMor#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ArtifactsStructureConfigurable.UI">
+        <settings>
+          <artifact-editor />
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="FacetStructureConfigurable.UI">
+        <settings>
+          <last-edited>No facets are configured</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="GlobalLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="JdkListConfigurable.UI">
+        <settings>
+          <last-edited>1.8 (2)</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ModuleStructureConfigurable.UI">
+        <settings>
+          <last-edited>image-identification-dev-02</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ProjectLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-dev-02.iml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-dev-02.iml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-dev-02.iml	(revision 33415)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/image-identification-development" isTestSource="false" />
+    </content>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/description.html
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/description.html	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/description.html	(revision 33415)
@@ -0,0 +1,1 @@
+<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/encodings.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/encodings.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/encodings.xml	(revision 33415)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/misc.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/misc.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/misc.xml	(revision 33415)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="ProjectKey">
+    <option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/modules.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/modules.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/modules.xml	(revision 33415)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/image-identification.iml" filepath="$PROJECT_DIR$/image-identification.iml" />
+    </modules>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/project-template.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/project-template.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/project-template.xml	(revision 33415)
@@ -0,0 +1,3 @@
+<template>
+  <input-field default="com.company">IJ_BASE_PACKAGE</input-field>
+</template>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/vcs.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/vcs.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/vcs.xml	(revision 33415)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="svn" />
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/workspace.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/workspace.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/.idea/workspace.xml	(revision 33415)
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="9bad4f92-4a7d-46a2-b6f0-94214c9f55cc" name="Default" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" />
+    </list>
+    <ignored path="$PROJECT_DIR$/out/" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="CoverageDataManager">
+    <SUITE FILE_PATH="coverage/image_identification_development$Main.ic" NAME="Main Coverage Results" MODIFIED="1562975922003" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
+  </component>
+  <component name="FindInProjectRecents">
+    <findStrings>
+      <find>aeu.ark+=13960=t93787r1w-10.png</find>
+      <find>returnArray</find>
+    </findStrings>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java" />
+        <option value="$PROJECT_DIR$/src/Main.java" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds" extendedState="6">
+    <option name="x" value="562" />
+    <option name="y" value="24" />
+    <option name="width" value="908" />
+    <option name="height" value="996" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane" />
+      <pane id="PackagesPane" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="GenerateAntBuildDialog.backupFiles" value="true" />
+    <property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" />
+    <property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
+    <property name="GenerateAntBuildDialog.generateSingleFile" value="true" />
+    <property name="GenerateAntBuildDialog.outputFileNameProperty" value="image-identification" />
+    <property name="full.screen.before.presentation.mode" value="false" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+    <property name="project.structure.last.edited" value="Modules" />
+    <property name="project.structure.proportion" value="0.15" />
+    <property name="project.structure.side.proportion" value="0.2" />
+    <property name="run.code.analysis.last.selected.profile" value="pProject Default" />
+    <property name="settings.editor.selected.configurable" value="editor.preferences.fonts.default" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager">
+    <configuration name="Main" type="Application" factoryName="Application" temporary="true">
+      <option name="MAIN_CLASS_NAME" value="Main" />
+      <module name="image-identification" />
+      <option name="VM_PARAMETERS" value="-Djava.library.path=$PROJECT_DIR$/../../opencv-3.4.2/build/lib" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <RunnerSettings RunnerId="Run" />
+      <ConfigurationWrapper RunnerId="Run" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Application.Main" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SvnConfiguration" cleanupOnStartRun="true">
+    <configuration>$USER_HOME$/.subversion</configuration>
+    <supportedVersion>125</supportedVersion>
+  </component>
+  <component name="SvnFileUrlMappingImpl">
+    <option name="myMappingRoots">
+      <list>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$" />
+        </SvnCopyRootSimple>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$/.idea" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$/.idea" />
+        </SvnCopyRootSimple>
+      </list>
+    </option>
+    <option name="myMoreRealMappingRoots">
+      <list>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$" />
+        </SvnCopyRootSimple>
+      </list>
+    </option>
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="9bad4f92-4a7d-46a2-b6f0-94214c9f55cc" name="Default" comment="" />
+      <created>1557697736662</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1557697736662</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="67" y="25" width="1613" height="1025" extended-state="6" />
+    <layout>
+      <window_info id="Designer" order="0" />
+      <window_info id="UI Designer" order="1" />
+      <window_info id="Capture Tool" order="2" />
+      <window_info id="Favorites" order="3" side_tool="true" />
+      <window_info id="Image Layers" order="4" />
+      <window_info active="true" content_ui="combo" id="Project" order="5" visible="true" weight="0.18379068" />
+      <window_info id="Structure" order="6" side_tool="true" weight="0.25" />
+      <window_info anchor="bottom" id="Terminal" order="0" weight="0.42638037" />
+      <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
+      <window_info anchor="bottom" id="Version Control" order="2" />
+      <window_info anchor="bottom" id="Messages" order="3" weight="0.32719836" />
+      <window_info anchor="bottom" id="Message" order="4" />
+      <window_info anchor="bottom" id="Find" order="5" weight="0.32924336" />
+      <window_info anchor="bottom" id="Run" order="6" weight="0.20245399" />
+      <window_info anchor="bottom" id="Debug" order="7" weight="0.24437627" />
+      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="10" />
+      <window_info anchor="bottom" id="Inspection Results" order="11" weight="0.32924336" />
+      <window_info anchor="right" id="Maven" />
+      <window_info anchor="right" id="Capture Analysis" order="0" />
+      <window_info anchor="right" id="Palette&#9;" order="1" />
+      <window_info anchor="right" id="Theme Preview" order="2" />
+      <window_info anchor="right" id="Maven Projects" order="3" />
+      <window_info anchor="right" id="Palette" order="4" />
+      <window_info anchor="right" id="Coverage" order="5" side_tool="true" weight="0.32991913" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="6" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="7" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="8" weight="0.25" />
+    </layout>
+    <layout-to-restore>
+      <window_info id="Designer" order="0" />
+      <window_info id="UI Designer" order="1" />
+      <window_info id="Capture Tool" order="2" />
+      <window_info id="Favorites" order="3" side_tool="true" />
+      <window_info id="Image Layers" order="4" />
+      <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" />
+      <window_info anchor="bottom" id="Terminal" order="0" />
+      <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
+      <window_info anchor="bottom" id="Version Control" order="2" />
+      <window_info anchor="bottom" id="Messages" order="3" />
+      <window_info anchor="bottom" id="Message" order="4" />
+      <window_info anchor="bottom" id="Find" order="5" weight="0.32924336" />
+      <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" />
+      <window_info anchor="bottom" id="Debug" order="7" weight="0.4" />
+      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="10" />
+      <window_info anchor="right" id="Capture Analysis" order="0" />
+      <window_info anchor="right" id="Palette&#9;" order="1" />
+      <window_info anchor="right" id="Theme Preview" order="2" />
+      <window_info anchor="right" id="Maven Projects" order="3" />
+      <window_info anchor="right" id="Palette" order="4" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="5" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="6" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" />
+    </layout-to-restore>
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="jar://$PROJECT_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/org/opencv/core/Mat.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/Object.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/jre/lib/rt.jar!/sun/misc/Launcher.class" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/jre/lib/rt.jar!/sun/instrument/InstrumentationImpl.class" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/ClassLoader.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/net/URLClassLoader.java" />
+    <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java" />
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="399">
+          <caret line="812" column="12" lean-forward="true" selection-start-line="812" selection-start-column="12" selection-end-line="812" selection-end-column="12" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="class#StartAndEndPoint#0;class#Main#0" />
+            <element signature="e#5318#5319#0" expanded="true" />
+            <element signature="e#5352#5353#0" expanded="true" />
+            <element signature="method#removeDuplicates#0;class#Main#0" />
+            <element signature="method#StandardDeviation#0;class#Main#0" />
+            <element signature="method#VarianceCalc#0;class#Main#0" />
+            <element signature="method#lineComparison#0;class#Main#0" />
+            <element signature="method#ClusterCheck#0;class#Main#0" />
+            <element signature="method#toBufferedImage#0;class#Main#0" />
+            <element signature="method#ClassifierPixelCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterOLD#0;class#Main#0" />
+            <element signature="method#ClassifierLineCluster#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterPt#0;class#Main#0" />
+            <element signature="method#LineCountOrCluster#0;class#Main#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ArtifactsStructureConfigurable.UI">
+        <settings>
+          <artifact-editor />
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="FacetStructureConfigurable.UI">
+        <settings>
+          <last-edited>No facets are configured</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="GlobalLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="JdkListConfigurable.UI">
+        <settings>
+          <last-edited>1.8</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ModuleStructureConfigurable.UI">
+        <settings>
+          <last-edited>image-identification</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ProjectLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Makefile	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Makefile	(revision 33415)
@@ -0,0 +1,8 @@
+#https://www.tensorflow.org/install/lang_java
+
+run-Classifier01:
+	javac terminalImageClassifer.java
+	java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ terminalImageClassifier
+
+
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Notes.txt
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Notes.txt	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/Notes.txt	(revision 33415)
@@ -0,0 +1,41 @@
+Houghlines in java.
+Houghlines does detect white lines. Use binary_inv to show with houghlineTest.png
+
+OTSU threshold gives best black and white response
+
+Would it be useful to process what lines have been detected?
+As in, filter out every line detected except for horizontal lines?
+
+BINARYINV seems to be result in a better looking image than canny for sheet music
+
+In houghlines parameters, having resoluation of 1 degree and 1 pixel makes sense. Would allow for sheet music image to be at any orientation.
+Threshold would ideally need to vary dependant on how much sheet music there is.
+Which brings to the table filtering. Having a good filter that eliminates noise leaves the sheet music free would be good. The binary inv would be suitable, since houghlines detect white lines.
+Need filter to denoize image. OTSU seems to do a good job.
+
+The threshold would need to be adjusted dependant on how many white pixels there are.
+houghlinesP has start and end points. where houghlines does not. Which is why houghlinesP performs better on a set of images becuz of the end points rather than just "a line must meet a certain threshold at that coordinate for it to be registered"
+Houghlines in order to be effetive must be scaled to suit the image.
+
+HoughlinesP contains this:
+minLinLength: The minimum number of points that can form a line. Lines with less than this number of points are disregarded.
+maxLineGap: The maximum gap between two points to be considered in the same line.
+
+____ _____     ______ 	______
+
+HoughlinesP can calculate on a local scale, comaparing the distance between just the gap in the line.
+Houghlines  only calculates on the lines scale, checking the whole lines point count(attenuator?) reaching over the threshold.
+
+This means houghlinesP can scale better and allow for more accurate results
+
+
+The mathRound does not make difference
+
+Drawing forloop with cols, seems to be less effective
+Even though it does employ same calculations? 
+https://stackoverflow.com/questions/29493267/how-to-detect-lines-using-houghlines-in-opencv-java
+
+
+
+not enough MP records with more than 10 pages
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.iml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.iml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.iml	(revision 33415)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+  </component>
+</module>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.properties
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.properties	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.properties	(revision 33415)
@@ -0,0 +1,4 @@
+path.variable.kotlin_bundled=/opt/idea/plugins/Kotlin/kotlinc
+path.variable.maven_repository=/home/cpb16/.m2/repository
+jdk.home.1.8=/usr/lib/jvm/java-8-oracle
+javac2.instrumentation.includeJavaRuntime=false
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/image-identification.xml	(revision 33415)
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="image-identification" default="all">
+  
+  
+  <property file="image-identification.properties"/>
+  <!-- Uncomment the following property if no tests compilation is needed -->
+  <!-- 
+  <property name="skip.tests" value="true"/>
+   -->
+  
+  <!-- Compiler options -->
+  
+  <property name="compiler.debug" value="on"/>
+  <property name="compiler.generate.no.warnings" value="off"/>
+  <property name="compiler.args" value=""/>
+  <property name="compiler.max.memory" value="700m"/>
+  <patternset id="ignored.files">
+    <exclude name="**/*.hprof/**"/>
+    <exclude name="**/*.pyc/**"/>
+    <exclude name="**/*.pyo/**"/>
+    <exclude name="**/*.rbc/**"/>
+    <exclude name="**/*.yarb/**"/>
+    <exclude name="**/*~/**"/>
+    <exclude name="**/.DS_Store/**"/>
+    <exclude name="**/.git/**"/>
+    <exclude name="**/.hg/**"/>
+    <exclude name="**/.svn/**"/>
+    <exclude name="**/CVS/**"/>
+    <exclude name="**/__pycache__/**"/>
+    <exclude name="**/_svn/**"/>
+    <exclude name="**/vssver.scc/**"/>
+    <exclude name="**/vssver2.scc/**"/>
+  </patternset>
+  <patternset id="library.patterns">
+    <include name="*.war"/>
+    <include name="*.swc"/>
+    <include name="*.zip"/>
+    <include name="*.egg"/>
+    <include name="*.ane"/>
+    <include name="*.jar"/>
+    <include name="*.ear"/>
+  </patternset>
+  <patternset id="compiler.resources">
+    <exclude name="**/?*.java"/>
+    <exclude name="**/?*.form"/>
+    <exclude name="**/?*.class"/>
+    <exclude name="**/?*.groovy"/>
+    <exclude name="**/?*.scala"/>
+    <exclude name="**/?*.flex"/>
+    <exclude name="**/?*.kt"/>
+    <exclude name="**/?*.clj"/>
+    <exclude name="**/?*.aj"/>
+  </patternset>
+  
+  <!-- JDK definitions -->
+  
+  <property name="jdk.bin.1.8" value="${jdk.home.1.8}/bin"/>
+  <path id="jdk.classpath.1.8">
+    <fileset dir="${jdk.home.1.8}">
+      <include name="jre/lib/charsets.jar"/>
+      <include name="jre/lib/deploy.jar"/>
+      <include name="jre/lib/ext/cldrdata.jar"/>
+      <include name="jre/lib/ext/dnsns.jar"/>
+      <include name="jre/lib/ext/jaccess.jar"/>
+      <include name="jre/lib/ext/jfxrt.jar"/>
+      <include name="jre/lib/ext/localedata.jar"/>
+      <include name="jre/lib/ext/nashorn.jar"/>
+      <include name="jre/lib/ext/sunec.jar"/>
+      <include name="jre/lib/ext/sunjce_provider.jar"/>
+      <include name="jre/lib/ext/sunpkcs11.jar"/>
+      <include name="jre/lib/ext/zipfs.jar"/>
+      <include name="jre/lib/javaws.jar"/>
+      <include name="jre/lib/jce.jar"/>
+      <include name="jre/lib/jfr.jar"/>
+      <include name="jre/lib/jfxswt.jar"/>
+      <include name="jre/lib/jsse.jar"/>
+      <include name="jre/lib/management-agent.jar"/>
+      <include name="jre/lib/plugin.jar"/>
+      <include name="jre/lib/resources.jar"/>
+      <include name="jre/lib/rt.jar"/>
+    </fileset>
+  </path>
+  
+  <property name="project.jdk.home" value="${jdk.home.1.8}"/>
+  <property name="project.jdk.bin" value="${jdk.bin.1.8}"/>
+  <property name="project.jdk.classpath" value="jdk.classpath.1.8"/>
+  <!-- Register Custom Compiler Taskdefs -->
+  <property name="javac2.home" value="${idea.home}/lib"/>
+  <path id="javac2.classpath">
+    <fileset dir="${javac2.home}">
+      <include name="javac2.jar"/>
+      <include name="jdom.jar"/>
+      <include name="asm-all*.jar"/>
+      <include name="jgoodies-forms.jar"/>
+    </fileset>
+  </path>
+  <target name="register.custom.compilers">
+    <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
+    <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
+  </target>
+  
+  <!-- Modules -->
+  
+  
+  <!-- Module image-identification -->
+  
+  <dirname property="module.image-identification.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.image-identification" value="${project.jdk.home}"/>
+  <property name="module.jdk.bin.image-identification" value="${project.jdk.bin}"/>
+  <property name="module.jdk.classpath.image-identification" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.image-identification" value="-encoding UTF-8 -source 8 -target 8 ${compiler.args}"/>
+  
+  <property name="image-identification.output.dir" value="${module.image-identification.basedir}/out/production/image-identification"/>
+  <property name="image-identification.testoutput.dir" value="${module.image-identification.basedir}/out/test/image-identification"/>
+  
+  <path id="image-identification.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="image-identification.module.production.classpath">
+    <path refid="${module.jdk.classpath.image-identification}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.runtime.production.module.classpath">
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.module.classpath">
+    <path refid="${module.jdk.classpath.image-identification}"/>
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.runtime.module.classpath">
+    <pathelement location="${image-identification.testoutput.dir}"/>
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.image-identification">
+    <patternset refid="ignored.files"/>
+  </patternset>
+  
+  <patternset id="excluded.from.compilation.image-identification">
+    <patternset refid="excluded.from.module.image-identification"/>
+  </patternset>
+  
+  <path id="image-identification.module.sourcepath">
+    <dirset dir="${module.image-identification.basedir}">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.image-identification" depends="compile.module.image-identification.production,compile.module.image-identification.tests" description="Compile module image-identification"/>
+  
+  <target name="compile.module.image-identification.production" depends="register.custom.compilers" description="Compile module image-identification; production classes">
+    <mkdir dir="${image-identification.output.dir}"/>
+    <javac2 destdir="${image-identification.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.image-identification}/javac">
+      <compilerarg line="${compiler.args.image-identification}"/>
+      <bootclasspath refid="image-identification.module.bootclasspath"/>
+      <classpath refid="image-identification.module.production.classpath"/>
+      <src refid="image-identification.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.image-identification"/>
+    </javac2>
+    
+    <copy todir="${image-identification.output.dir}">
+      <fileset dir="${module.image-identification.basedir}/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.image-identification.tests" depends="register.custom.compilers,compile.module.image-identification.production" description="compile module image-identification; test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.image-identification" description="cleanup module">
+    <delete dir="${image-identification.output.dir}"/>
+    <delete dir="${image-identification.testoutput.dir}"/>
+  </target>
+  
+  <target name="init" description="Build initialization">
+    <!-- Perform any build initialization in this target -->
+  </target>
+  
+  <target name="clean" depends="clean.module.image-identification" description="cleanup all"/>
+  
+  <target name="build.modules" depends="init, clean, compile.module.image-identification" description="build all modules"/>
+  
+  <target name="all" depends="build.modules" description="build all"/>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/Main.java	(revision 33415)
@@ -0,0 +1,877 @@
+/*
+                StartAndEndPoint l1 = parseArray[i];
+                StartAndEndPoint l2 = parseArray[i+ 1];
+                //CHECK WHICH line starts after the other
+                //If l1 is starting after, then comparisons are based around l1.s
+                //System.out.println("l1: " + l1.getP1().x);
+                //System.out.println("l2: " + l2.getP1().x);
+
+                System.out.println("1.0: L1S: " + l1.getP1().x + " larger than L2S: " + l2.getP1().x);
+                if(l1.getP1().x > l2.getP1().x) {
+                    System.out.println("1.1: Comparing L1S: " + l1.getP1().x + " less than L2E: " + l2.getP2().x);
+                    if (l1.getP1().x < l2.getP2().x) {
+                        //AND
+                        System.out.println("1.2: Comparing L1S: " + l1.getP1().x + " larger than L2S: " + l2.getP1().x);
+                        if (l1.getP1().x > l2.getP1().x) {
+                            System.out.println("1: Success. NEXT");
+                            //IT IS INTERSECTED
+                            continue;
+                        }
+                        else {
+                            //FAILED SECOND COMPARISON
+                            System.out.println("1: Fail");
+                        }
+                    }
+                    else {
+                        System.out.println("Checking other line");
+                    }
+                    System.out.println("2.0: L2S: " + l2.getP1().x + " larger than  L1S: " + l1.getP1().x);
+                }
+                //If l2 is starting after, then comparisons are based around l2.s
+                else if(l2.getP1().x > l1.getP1().x) {
+                    System.out.println("2.1: Comparing L2S: " + l1.getP1().x + " less than L1E: " + l2.getP2().x);
+                    if (l2.getP1().x < l1.getP2().x) {
+                        //AND
+                        System.out.println("2.2: Comparing L2S: " + l2.getP1().x + " larger than L1S: " + l1.getP1().x);
+                        if (l2.getP1().x > l1.getP1().x) {
+                            System.out.println("2: Success");
+                            //IT IS INTERSECTED
+                            //continue;
+                        }
+                        else {
+                            //FAILED SECOND COMPARISON
+                            System.out.println("2: Fail");
+                            //return false;
+                        }
+                    }
+                    else {
+                        System.out.println("Failed second comparison RETURN FALSE");
+                        return false;
+                    }
+                    //return false;
+                }
+                else{
+                    System.out.println("NEITHER RETURN FALSE");
+                    return false;
+                }
+  */
+
+import org.opencv.core.*;
+import org.opencv.core.Point;
+import org.opencv.highgui.HighGui;
+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 java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import javax.imageio.ImageIO;
+
+//REFERENCES:
+//https://docs.opencv.org/3.4.3/d9/db0/tutorial_hough_lines.
+//https://stackoverflow.com/questions/43443309/count-red-pixel-in-a-given-image
+//https://www.wikihow.com/Calculate-Percentage-in-Java
+//https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+//https://beginnersbook.com/2013/12/java-arraylist-of-object-sort-example-comparable-and-comparator/
+//https://www.programiz.com/java-programming/examples/standard-deviation
+//https://www.geeksforgeeks.org/how-to-remove-duplicates-from-arraylist-in-java/
+//https://stackoverflow.com/questions/7988486/how-do-you-calculate-the-variance-median-and-standard-deviation-in-c-or-java/7988556
+//https://stackoverflow.com/questions/10396970/sort-a-list-that-contains-a-custom-class
+//https://stackoverflow.com/questions/37946482/crop-images-area-with-opencv-java
+//https://docs.opencv.org/3.4/dd/dd7/tutorial_morph_lines_detection.html
+
+
+
+//GOAL for 21st
+
+
+//Classifier 01
+//Have args so can call "java image-identification-classifier01 XX XX"
+//args can be parameters in algorthim such as threshold or theta?
+//Run on 5000 images.
+//Record success rates
+//All done with makefile
+
+
+//But first understand houghline transform
+//Know what the algorithm being used is doing.
+//MAke constants for this classifier
+//Make java be able to run on CMD line
+
+public class Main {
+    //GLOBAL_CONSTANTS
+    static int CLASSIFIER_HOUGHLINESP_MIN 	= 10;
+    static int CLASSIFIER_HOUGHLINESP_MAX 	= 65;
+    static int HOUGHLINEP_THRESHOLD			= 10;
+    static int STANDARD_DEVIATION_THRESHOLD = 6;
+    static int MINLINECOUNT                 = 40;
+    static int MAXLINEGAP              	    = 1;  //4
+    static double THRESHOLD_C               = 4;
+    static double SLOPEGRADIENT			  	= 0.02;
+    static double CLUSTER_DISTANCE_MAX      = 40;
+    static double CLUSTER_DISTANCE_MIN      = 2;
+
+    //DEPENDENT FUNCTIONS AND CLASSES
+    static class StartAndEndPoint {
+        //PRIVATES
+        private Point _p1;
+        private Point _p2;
+        //CONSTRUCTOR
+        public StartAndEndPoint(Point p1, Point p2){
+            _p1 = p1;
+            _p2 = p2;
+        }
+        //GETTERS
+        public Point getP1(){
+            return _p1;
+        }
+        public Point getP2(){
+            return  _p2;
+        }
+        //SETTERS
+        public void setP1(Point p1){
+            _p1 = p1;
+        }
+        public void setP2(Point p2){
+            _p2 = p2;
+        }
+
+        //ToString
+        public  String toString(){
+            return "Start: " + _p1 + " End: " + _p2;
+        }
+
+    }
+
+    public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list) {
+        //DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED
+        // Function to remove duplicates from an ArrayList
+        // Create a new ArrayList
+        ArrayList<T> newList = new ArrayList();
+        // Traverse through the first list
+        for (T element : list) {
+            // If this element is not present in newList
+            // then add it
+            if (!newList.contains(element)) {
+                newList.add(element);
+            }
+        }
+        // return the new list
+        return newList;
+        //DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED
+    }
+    public static double StandardDeviation(double parseArray[]) {
+
+        double mean;
+        double sum =0.0;
+        double standardDeviation = 0.0;
+        //calculate sum of array
+        for(int i =0; i < parseArray.length; i++){
+            sum += parseArray[i];
+        }
+        //calculate mean of array
+        mean = sum/parseArray.length;
+        //calculate SD of array
+        for(int j =0; j < parseArray.length; j++){
+            standardDeviation += Math.pow(parseArray[j]-mean, 2);
+        }
+        return Math.sqrt(standardDeviation/parseArray.length);
+
+
+    }
+    public static double VarianceCalc(StartAndEndPoint parseArray[]){
+        double sum =0;
+        double temp =0;
+        double mean, variance;
+        int size = parseArray.length;
+        //Calculate sum of array
+        for(int i =0; i < parseArray.length; i++){
+            sum += parseArray[i].getP1().y;
+        }
+        //Calculate mean of array
+        mean = sum/parseArray.length;
+        //Calculate variants
+        for(int i =0; i < size; i++){
+            temp += Math.pow((parseArray[i].getP1().y-mean),2);
+        }
+        variance = Math.abs(temp/(size -1));
+        //System.out.println("VARIANCE: " + variance);
+        return variance;
+    }
+    public static Boolean lineComparison(double baseLineS, double compareLineS, double compareLineE ){
+        //System.out.print("Comparing baseLineS: " + baseLineS + " with compareLineE: " + compareLineE + " and compareLineS: " + compareLineS);
+        if(baseLineS < compareLineE && baseLineS > compareLineS){
+            return true;
+        }
+        return false;
+    }
+    public static Boolean ClusterCheck(StartAndEndPoint parseArray[]){
+        try {
+            //System.out.println("LENGTH: " + parseArray.length);
+            //MAKE THREE COMPARISONS
+            //After clusters have been found.
+            //Check if  their x positions intersect
+            //Logic being
+            //(L1.S < L2.E && L1.S > L2.S)
+            //or
+            //(L2.S < L1.E && L2.S > L1.S)
+            //Variance is using Start of line point.
+            //USING VARIANTS
+            double variance = VarianceCalc(parseArray);
+            Boolean consistent = false;
+            if (variance <= CLUSTER_DISTANCE_MAX && variance > CLUSTER_DISTANCE_MIN) {
+
+                for (int i = 0; i < parseArray.length - 1; i++) {
+                    //System.out.println(i);
+                    double l1_S = parseArray[i].getP1().x;
+                    double l1_E = parseArray[i].getP2().x;
+                    double l2_S = parseArray[i + 1].getP1().x;
+                    double l2_E = parseArray[i + 1].getP2().x;
+
+                    //Check which starts after
+                    if (l1_S >= l2_S) {
+                        //baseLineStart is l1_S (call with lineComparison)
+                        consistent = lineComparison(l1_S, l2_S, l2_E);
+                    } else if (l2_S > l1_S) {
+                        //baseLineStart is l2_S (call with lineComparison)
+                        consistent = lineComparison(l2_S, l1_S, l1_E);
+                    } else {
+                        System.err.println("An error, comparing l1_S and l2_S, has occurred");
+                    }
+
+                    //Check if false was returned;
+                    if (consistent == false) {
+                        /*System.out.print(" X positions of two lines did not overlap each other:" + '\t');
+                        System.out.print("l1_S: " + l1_S + '\t');
+                        System.out.print("l1_E: " + l1_E + '\t');
+                        System.out.print("l2_S: " + l2_S + '\t');
+                        System.out.print("l2_E: " + l2_E);
+                        System.out.println(" ");*/
+                        return false;
+                    }
+                }
+                //Have been through for loop, maintaining consistent being true.
+                //Have also meet the variance MIN and MAX requirement. Therefore it is a cluster
+                return true;
+            }
+            //System.out.println("Did not meet Cluster Distance Min and Max requirements, Variance = " + variance);
+            return false;
+        }
+        catch (Exception e){
+            System.err.println("           "+e.getMessage());
+            return false;
+        }
+    }
+
+
+    //CLASSIFYING FUNCTIONS
+    private static  BufferedImage toBufferedImage(Mat mat){
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+        try{
+            int type = BufferedImage.TYPE_3BYTE_BGR;
+            int bufferSize = mat.channels() * mat.cols() * mat.rows();
+            byte[] b = new byte[bufferSize];
+            //get all the pixels
+            mat.get(0, 0, b);
+            BufferedImage image = new BufferedImage(mat.cols(), mat.rows(), type);
+            final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+            System.arraycopy(b, 0, targetPixels, 0, b.length);
+            return image;
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+        return null;
+    }
+    private static boolean ClassifierPixelCount(BufferedImage img){
+        try {
+            //Read file
+            //BufferedImage img = ImageIO.read(new File(processedFile));
+            int x = img.getWidth();
+            int y = img.getHeight();
+            int pixelCount  = 0;
+            int redCount    = 0;
+            float percentage = 0;
+
+            //Go Thru every pixel
+            for(int i=0; i < y; i++){
+                for(int j=0;j < x; j++){
+                    //Get value for current pixels RGB value
+                    int currPixelRGB = img.getRGB(j, i);
+                    //Check if pixel is red (hex value of red)
+                    if(currPixelRGB == 0xFFFF0000){
+                        redCount++;
+                    }
+                    pixelCount++;
+                }
+            }
+            //Calculate percentage of Red in image
+            percentage = ((float)redCount/(float)pixelCount)*(float)100;
+            //If more than %10 and less than %50 then its sheet music!
+            if(percentage > CLASSIFIER_HOUGHLINESP_MIN && percentage < CLASSIFIER_HOUGHLINESP_MAX){ //MAKE THESE CONSTANTS!!
+                return true;}
+        }
+        catch (Exception e) {
+            System.err.println(e);
+        }
+        return false;
+    }
+    private static boolean ClassifierLineCount(int lineCount){
+
+           if(lineCount>MINLINECOUNT){
+                return true;
+            }
+            else{
+                return false;
+            }
+    }
+    private static ArrayList ClassifierLineClusterOLD(BufferedImage img){
+        ArrayList returnArray = new ArrayList();
+        try {
+
+            //IF THIS WORKS THEN IMPLEMENT A VERSION THAT USES POINTS from the draw line code.
+            //ALSO CHECK OUT K NEAREST NEIGHBOR?
+            //0xFFFF0000 = RED
+
+            //go thru every pixel until find red pixel
+            //get y pos of red pixel
+            //continue with loop until find another red pixel
+            //get y pos of red pixel
+            //compare y pos (if close together then continue loop) else break
+
+            int x = img.getWidth();
+            int y = img.getHeight();
+            int closeLineCount = 0;
+            ArrayList<Integer> redPixelYpos = new ArrayList<Integer>();
+
+            //Go Thru every pixel
+            for(int i=0; i < y; i++){
+                for(int j=0;j < x; j++){
+                    //Get value for current pixels RGB value
+                    int currPixelRGB = img.getRGB(j, i);
+                    //Check if pixel is red (hex value of red)
+                    if(currPixelRGB == 0xFFFF0000) {
+
+                        //Store y pos of red pixel if there is no duplicate
+                        if(!redPixelYpos.contains(i)){
+                            redPixelYpos.add(i);
+                            //System.out.println(i );
+                        }
+                    }
+                }
+            }
+            //Check if any of the lines found are close together and that there has been more than one line found
+            if(redPixelYpos.size()>1){
+                //go through list and compare every value
+                for(int i =0; i< redPixelYpos.size(); i++){
+                    //System.out.println("i: " +redPixelYpos.get(i));
+                    for(int j=0; j< redPixelYpos.size(); j++){
+                        //System.out.println("j: "+redPixelYpos.get(j));
+                        //Check if difference is less than 4 and the values are not duplicates.
+                        if(Math.abs(redPixelYpos.get(i) - redPixelYpos.get(j)) < 4 && !redPixelYpos.get(j).equals(redPixelYpos.get(i))){
+                            closeLineCount++;
+                        }
+                    }
+                }
+            }
+            int clusterCount = closeLineCount/4;
+
+            if(closeLineCount >= 4){
+                returnArray.add(true);
+                returnArray.add(closeLineCount);
+                returnArray.add(clusterCount);
+            }
+            else{
+                returnArray.add(false);
+                returnArray.add(closeLineCount);
+                returnArray.add(clusterCount);
+            }
+        }
+        catch (Exception e) {
+            System.err.println(e);
+        }
+    return returnArray;
+    }
+    private static ArrayList ClassifierLineCluster(ArrayList<StartAndEndPoint> linePointsArray, Mat clustersFoundRGB){
+
+        /*
+        ADDITION:
+        After clusters have been found.
+        Check if x positions intersect at all
+            StartXPos of p1
+
+        This will check for a cluster of lines that are close together.
+        1. Go through the list of Y positions(start point) in parsed array.
+            If, there is a small distance between them,
+                then, add to closeLineArray.
+
+        Have all Y positions that are close to each other now.
+        Need to find the lines that are clustered together.
+
+        Now check if there are four of these are close to each other.
+        2.  Go through list of closeLine.
+                Get first four lines, traversing down a step each iteration {0,1,2,3} -> {1,2,3,4} -> {2,3,4,5}
+                If, those 4 lines are close together,
+                    Then, add them to a new array that holds Line Cluster Values.
+                    Go to line 4 positions down since, as do not want duplicates.
+
+        3.
+        */
+
+        ArrayList returnArray = new ArrayList();
+        ArrayList<Double> closeLineYPos = new ArrayList();
+        ArrayList<double[]> clusterArray = new ArrayList();
+        int clusterCount = 0;
+        try {
+            if(linePointsArray.size()> 1) {
+
+                /*
+                //Display input array TESTING PURPOSES
+                for (int i = 0; i < linePointsArray.size(); i++) {
+                    System.out.println(linePointsArray.get(i).toString());
+                }
+                */
+
+                //1. Check if y points are close together
+                //go thru list and compare values against each other
+                for (int i = 0; i < linePointsArray.size(); i++){
+                    //System.out.println("i: "+ linePointsArray.get(i).getP1().y);
+                    for (int j = 0; j < linePointsArray.size(); j++) {
+                        //System.out.println("j: "+ linePointsArray.get(j).getP1().y);
+                        //Check if difference is less than 4 and the values are not duplicates.
+                        if(Math.abs(linePointsArray.get(j).getP1().y - linePointsArray.get(i).getP1().y) < 5){
+                            if(linePointsArray.get(j).getP1().y != linePointsArray.get(i).getP1().y){
+                                closeLineYPos.add(linePointsArray.get(j).getP1().y);
+
+                            }
+                        }
+                    }
+                }
+                /*for (double num : closeLineYPos){
+                      System.out.println(num);
+                } */
+
+                //2. Now check if there are four of these are close to each other.
+                //Go through all of the items in this list and check if four of them are close together
+                //Check first four items, traverse down a step {0,1,2,3} -> {1,2,3,4} -> {2,3,4,5}
+                //If 4 items are close together,
+                    //Then add them to a new array that holds Line Cluster Values.
+                    //Go down 4 positions down since, as do not want duplicates.
+
+                //Now have an array of at least four lines that are close together.
+                //Sort array and remove duplicates
+                Collections.sort(closeLineYPos);
+
+
+
+                closeLineYPos = removeDuplicates(closeLineYPos);
+
+                //DISPLAYING AS EXCEPTED! WOO!
+
+                for (double y : closeLineYPos){
+                    System.out.println("CloseLineYPos: " + y);
+                }
+                if(closeLineYPos.size() >= 4) {
+                    //FOR every item in array of CloseLines
+                    for(int i= 0; i< closeLineYPos.size(); i++){
+                        //If last comparator is at end of array.
+                        if(i + 4 >= closeLineYPos.size()){
+                            break;
+                        }
+                        else{
+
+                            //Add 4 values of CloseLine Array to a tempArray
+                            double[] tempArray = new double[4];
+                            tempArray[0] = closeLineYPos.get(i);
+                            tempArray[1] = closeLineYPos.get(i + 1);
+                            tempArray[2] = closeLineYPos.get(i + 2);
+                            tempArray[3] = closeLineYPos.get(i + 3);
+
+                            //Check standard deviation between these 4 values.
+                            //If it SD is less than 5 then it is considered to be a cluster of lines.
+
+
+                            if(StandardDeviation(tempArray) < STANDARD_DEVIATION_THRESHOLD){
+                                //System.out.println("tempArray PT: "+tempArray[0] + " , " + tempArray[1] + " , " + tempArray[2] + " , " + tempArray[3]);
+                                //System.out.println("tempArray SD: " + StandardDeviation(tempArray));
+                                //Store array
+                                clusterArray.add(tempArray);
+                                //If I + 4 is less than the size of the array then increment by 4
+                                //Go down +4 positions in closeLineYPos array
+                                if((i + 4 < closeLineYPos.size())){
+                                    //System.out.println("IF, i = " + i + " -> "+ (i+4) + ", CloseLineYpos size= " + closeLineYPos.size());
+                                    i = i+4;
+                                }
+                                else{
+                                    //break
+                                    //System.out.println("ELSE, i = " + i+ " closeLineYpos size= " + closeLineYPos.size());
+                                    Thread.sleep(2000);
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+                /*
+                System.out.println("Cluster Coordinates: ");
+                for(double[] items : clusterArray){
+                    for(int i = 0; i <items.length; i++){
+                        System.out.println("ITEMS: "+ items[i]);
+                    }
+                }
+                */
+                //Setup Drawing clusters found.
+                //For every pt given the input array
+                for(StartAndEndPoint pt : linePointsArray){
+                    //Go through every the Arrays in the clusterArray(clustered lines)
+                    for(int i =0; i < clusterArray.size(); i++){
+                        //Go through every item in the array
+                        for(double item : clusterArray.get(i)) {
+                            //Check if the curr item is equal to current pt
+                            if (item == pt.getP1().y){
+                                //calculate a different colour for each line
+
+                                //Draw a line
+                                Imgproc.line(clustersFoundRGB, pt.getP1(), pt.getP2(), new Scalar(0, 255, 0), 1, Imgproc.LINE_4, 0);
+                            }
+                        }
+                    }
+
+                }
+
+                clusterCount = clusterArray.size();
+                //SETUP RETURN ARRAY
+                if(clusterCount >= 1){
+                    returnArray.add(true);
+                    returnArray.add(closeLineYPos.size());
+                    returnArray.add(clusterCount);
+                    returnArray.add(clustersFoundRGB);
+                }
+                else{
+                    returnArray.add(false);
+                    returnArray.add(closeLineYPos.size());
+                    returnArray.add(clusterCount);
+                }
+            }
+        }
+        catch (Exception e) {
+            System.err.println(e);
+        }
+        return returnArray;
+    }
+    private static ArrayList ClassifierLineClusterPt(ArrayList<StartAndEndPoint> linePointsArray, Mat clustersFoundRGB){
+        /*
+        ADDITION:
+        This will check for a cluster of lines that are close together.
+        1. Go through the list of Y positions(start point) in parsed array.
+            If, there is a small distance between them,
+                then, add to closeLineArray.
+
+        Have all Y positions that are close to each other now.
+        Need to find the lines that are clustered together.
+
+        Now check if there are four of these are close to each other.
+        2.  Go through list of closeLine.
+                Get first four lines, traversing down a step each iteration {0,1,2,3} -> {1,2,3,4} -> {2,3,4,5}
+                If, those 4 lines are close together,
+                    Then, add them to a new array that holds Line Cluster Values.
+                    Go to line 4 positions down since, as do not want duplicates.
+
+        3.
+        */
+        ArrayList returnArray = new ArrayList();
+        ArrayList<StartAndEndPoint> closeLinePts = new ArrayList();
+        ArrayList<StartAndEndPoint[]> clusterPtArray = new ArrayList();
+        int clusterCount = 0;
+        try {
+            if(linePointsArray.size()> 1) {
+                /*
+                //Display input array TESTING PURPOSES
+                for (int i = 0; i < linePointsArray.size(); i++) {
+                    System.out.println(linePointsArray.get(i).toString());
+                }
+                */
+                //1. Check if y points are close together
+                //go thru list and compare values against each other
+                for (int i = 0; i < linePointsArray.size(); i++){
+                    //System.out.println("i: "+ linePointsArray.get(i).getP1().y);
+                    for (int j = 0; j < linePointsArray.size(); j++) {
+                        //System.out.println("j: "+ linePointsArray.get(j).getP1().y);
+                        //Check if difference is less than 4 and the values are not duplicates.
+                        if(Math.abs(linePointsArray.get(j).getP1().y - linePointsArray.get(i).getP1().y) < 5){
+                            if(linePointsArray.get(j).getP1().y != linePointsArray.get(i).getP1().y){
+                                closeLinePts.add(linePointsArray.get(i));
+                            }
+                        }
+                    }
+                }
+
+                //2. Now check if there are four of these are close to each other.
+                //Go through all of the items in this list and check if four of them are close together
+                //Check first four items, traverse down a step {0,1,2,3} -> {1,2,3,4} -> {2,3,4,5}
+                //If 4 items are close together,
+                //Then add them to a new array that holds Line Cluster Values.
+                //Go down 4 positions down since, as do not want duplicates.
+
+                //Now have an array of at least four lines that are close together.
+                //Sort array and remove duplicates
+                Collections.sort(closeLinePts, new Comparator<StartAndEndPoint>() {
+                    @Override
+                    public int compare(StartAndEndPoint p1, StartAndEndPoint p2) {
+                        return (int)(p1.getP1().y - p2.getP1().y);
+                    }
+                });
+                closeLinePts = removeDuplicates(closeLinePts);
+                //DISPLAYING AS EXCEPTED! WOO!
+                /*for (StartAndEndPoint pt : closeLinePts) {
+                    System.out.println("CloseLinePTs: " + pt.getP1().y);
+                }*/
+
+
+                if(closeLinePts.size() >= 4) {
+                    //FOR every item in array of CloseLines
+                    for(int i= 0; i < closeLinePts.size(); i++){
+                        //If last comparator is at end of array.
+                        if(i + 4 >= closeLinePts.size()){
+                            break;
+                        }
+                        else{
+                            //Add 4 values of CloseLinePt Array to a tempArray
+                            StartAndEndPoint[] tempPtArray = new StartAndEndPoint[4];
+                            tempPtArray[0] = closeLinePts.get(i);
+                            tempPtArray[1] = closeLinePts.get(i + 1);
+                            tempPtArray[2] = closeLinePts.get(i + 2);
+                            tempPtArray[3] = closeLinePts.get(i + 3);
+
+                            //Check standard deviation between these 4 values.
+                            //If it SD is less than 5 then it is considered to be a cluster of lines.
+                            if(ClusterCheck(tempPtArray)){
+                                //System.out.println("tempArray PT: "+tempPtArray[0] + " , " + tempPtArray[1] + " , " + tempPtArray[2] + " , " + tempPtArray[3]);
+                                //Store array
+                                clusterPtArray.add(tempPtArray);
+                                //If I + 4 is less than the size of the array then increment by 4
+                                //Go down +4 positions in closeLineYPos array
+                                if((i + 4 < closeLinePts.size())){
+                                    //System.out.println("IF, i = " + i + " -> "+ (i+4) + ", CloseLineYpos size= " + closeLineYPos.size());
+                                    i = i+4;
+                                }
+                                else{
+                                    //break
+                                    Thread.sleep(2000);
+                                    //System.out.println("End of closeLinePts -> break , i = " + i+ " closeLineYpos size= " + closeLinePts.size());
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+
+                /*System.out.println("Cluster Coordinates: ");
+                for(StartAndEndPoint[] items : clusterPtArray){
+                    for(int i = 0; i <clusterPtArray.size(); i++){
+                        System.out.println("ITEMS: "+ items);
+                    }
+                }*/
+
+                //Setup Drawing clusters found.
+                //For every pt given the input array
+                for(StartAndEndPoint pt : linePointsArray){
+                    //Go through every the Arrays in the clusterArray(clustered lines)
+                    for(int i =0; i < clusterPtArray.size(); i++){
+                        //Go through every item in the array
+                        for(StartAndEndPoint item : clusterPtArray.get(i)) {
+                            //Check if the curr item is equal to current pt
+                            if (item.getP1().y == pt.getP1().y){
+                                //calculate a different colour for each line
+                                //Draw a line
+                                Imgproc.line(clustersFoundRGB, pt.getP1(), pt.getP2(), new Scalar(0, 255, 0), 1, Imgproc.LINE_4, 0);
+                            }
+                        }
+                    }
+                }
+
+                clusterCount = clusterPtArray.size();
+                //SETUP RETURN ARRAY
+                if(clusterCount >= 1){
+                    returnArray.add(true);
+                    returnArray.add(clusterCount);
+                    returnArray.add(clustersFoundRGB);
+                }
+                else{
+                    returnArray.add(false);
+                    returnArray.add(clusterCount);
+                    returnArray.add(clustersFoundRGB);
+                }
+            }
+        }
+        catch (Exception e) {
+            System.err.println(e.getMessage());
+        }
+        return returnArray;
+    }
+
+    //SUPER CLASSIFIER FUNCTIONS
+    private static boolean LineCountOrCluster(int lineCount, ArrayList<StartAndEndPoint> linePointsArray, Mat clustersFoundRGB){
+        ArrayList lineClusterResult = ClassifierLineClusterPt(linePointsArray, clustersFoundRGB);
+
+
+        //String test = ClassifierLineClusterPt(linePointsArray, clustersFoundRGB).get(0).toString();
+        if(ClassifierLineCount(lineCount) == true){
+            System.out.println("LineCount classifier Successful: " +   '\t' +"LinesFound: " + lineCount);
+            return true;
+        }
+        else if(lineClusterResult.get(0).toString() == "true"){
+            System.out.println("LineCluster classifier Successful: " + '\t' + "LinesFound: " + lineCount + '\t' + "ClustersFound: " + lineClusterResult.get(1));
+
+            return  false;
+        }
+        return false;
+    }
+
+    //MAIN
+    public static void main(String[] args) {
+
+        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+
+        try {
+            ArrayList<StartAndEndPoint> pointArrayList = new ArrayList<>();
+
+            //Variables
+            Mat edgesDetected = new Mat();
+            Mat mid = new Mat();
+            Mat edgesDetectedRGB = new Mat();
+            Mat clustersFoundRGB = new Mat();
+            String directory = "/Scratch/cpb16/is-sheet-music-encore/download-images/MU/";
+            String hiresDirectory = "/Scratch/cpb16/is-sheet-music-encore/hires-download-images/";
+
+            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //mdp.39015097852365-2.png 176 lines    Contents page.
+            //mdp.39015097852555-3.png 76  lines
+            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOTNOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //coo.31924062612282-9.png 8   lines
+            //String default_file = directory+"NotSheetMusic/coo.31924062612282-9.png";
+            //String default_file = directory+"NotSheetMusic/mdp.39015097852365-2.png";
+            //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
+            //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t2q53nq6w-6.png";
+            String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/test-coo.31924062612282-9.png";
+            //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t9z03w65z-4.png";
+
+            //System.out.println(default_file);
+            //String default_file = "TestImages/NotSheetMusic01.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
+            Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            // Edge detection
+
+            Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, THRESHOLD_C);
+            //TEST PARAMETERSImgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 531,1);
+
+
+//            //IGNORE BORDERS OF IMAGE (using crop)
+//            Imgproc.adaptiveThreshold(original, mid,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, 2);
+//            double maxX = mid.size().width;
+//            double maxY = mid.size().height;
+//            Point cp1 = new Point(maxX/10, maxY/10);
+//            Point cp2 = new Point(maxX - cp1.x, maxY -cp1.y);
+//            Rect rectCrop = new Rect(cp1, cp2);
+//            edgesDetected = mid.submat(rectCrop);
+
+
+            //****************MORPHOLOGY****************************************************************************************
+            //ADDIOTIONAL FILTERING TO STOP STREAKS
+            //LOOK INTO STREAKS MORPHOGOLY.
+            //****************MORPHOLOGY****************************************************************************************
+
+            //Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(4,8));
+            //Imgproc.morphologyEx(original, mid, Imgproc.MORPH_OPEN, kernel);
+            //Imgproc.adaptiveThreshold(mid, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, 2);
+
+
+
+            //****************MORPHOLOGY****************************************************************************************
+
+
+
+
+
+
+
+
+            //Convert to RGB for future use
+            Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR);
+            clustersFoundRGB = edgesDetectedRGB.clone();
+
+            Mat linesP = new Mat(); // will hold the results of the detection
+            //(edgeDetectedImage, outputOfDetection(r,Îž), resolution of rho, resolution of theta, threshold (minimum num of intersections)
+
+            double minLineLength = edgesDetectedRGB.size().width/8;
+
+            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength,MAXLINEGAP); // runs the actual detection
+            //System.out.println("Before Gradient Filtering num lines: " + linesP.rows());
+
+            // Draw the lines
+            for (int x = 0; x < linesP.rows(); x++) {
+                double[] l = linesP.get(x, 0);
+                Point p1 = new Point(l[0], l[1]);
+                Point p2 = new Point(l[2], l[3]);
+                double m = Math.abs(p2.y - p1.y)/(p2.x - p1.x);
+
+                if(m<=SLOPEGRADIENT) {
+                    Imgproc.line(edgesDetectedRGB, p1, p2, new Scalar(0, 0, 255), 1, Imgproc.LINE_4, 0);
+                    horizontalLineCount++;
+                    pointArrayList.add(new StartAndEndPoint(p1, p2));
+                }
+
+            }
+            //Point is a co ordinate (x, y)
+            //Prove by finding number of points from one end to other:
+            //Get width of image.
+            //File filenameTest = new File("TestImages/NotSheetMusic02.png");
+            //BufferedImage i = ImageIO.read(filenameTest);
+            BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB);
+
+
+            //Display Results
+            //HighGui.imshow("Source", original);
+            //HighGui.imshow("Just Edges", justEdges); //TESTING
+
+
+            HighGui.imshow("LINESFOUND", edgesDetectedRGB);
+            HighGui.resizeWindow("LINESFOUND", 1000,1000);
+            
+            //HighGui.imshow("CLUSTERS FOUND", clustersFoundRGB);
+
+            //HighGui.imshow("Detected Lines (in red) - negative", edgesDetectedRGBProb);
+
+            System.out.println("LINE COUNT RESULT:   " +  ClassifierLineCount(horizontalLineCount) + '\t' +"LinesFound: " + horizontalLineCount); //COUNT OF LINES CLASSIFICATION
+            //System.out.println("LINE CLUSTER RESULT: " +  ClassifierLineClusterOLD(toBeClassifiedImg).get(0) + '\t' + "LinesFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(1) + '\t' + "ClustersFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(2));
+            //System.out.println("NEW CLUSTER RESULTS: " +  ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(0) + '\t' + "LinesFound: " + horizontalLineCount + '\t' + "ClustersFound: " + ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(1));
+            //System.out.println(ClassifierLineClusterPt(pointArrayList, clustersFoundRGB));
+
+            //System.out.println("TEST: " + LineCountOrCluster(horizontalLineCount, pointArrayList, clustersFoundRGB));
+
+            // Wait and Exit
+            HighGui.waitKey();
+            System.exit(0);
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+    }
+}
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/src/MainMorph.java	(revision 33415)
@@ -0,0 +1,311 @@
+/*
+                StartAndEndPoint l1 = parseArray[i];
+                StartAndEndPoint l2 = parseArray[i+ 1];
+                //CHECK WHICH line starts after the other
+                //If l1 is starting after, then comparisons are based around l1.s
+                //System.out.println("l1: " + l1.getP1().x);
+                //System.out.println("l2: " + l2.getP1().x);
+
+                System.out.println("1.0: L1S: " + l1.getP1().x + " larger than L2S: " + l2.getP1().x);
+                if(l1.getP1().x > l2.getP1().x) {
+                    System.out.println("1.1: Comparing L1S: " + l1.getP1().x + " less than L2E: " + l2.getP2().x);
+                    if (l1.getP1().x < l2.getP2().x) {
+                        //AND
+                        System.out.println("1.2: Comparing L1S: " + l1.getP1().x + " larger than L2S: " + l2.getP1().x);
+                        if (l1.getP1().x > l2.getP1().x) {
+                            System.out.println("1: Success. NEXT");
+                            //IT IS INTERSECTED
+                            continue;
+                        }
+                        else {
+                            //FAILED SECOND COMPARISON
+                            System.out.println("1: Fail");
+                        }
+                    }
+                    else {
+                        System.out.println("Checking other line");
+                    }
+                    System.out.println("2.0: L2S: " + l2.getP1().x + " larger than  L1S: " + l1.getP1().x);
+                }
+                //If l2 is starting after, then comparisons are based around l2.s
+                else if(l2.getP1().x > l1.getP1().x) {
+                    System.out.println("2.1: Comparing L2S: " + l1.getP1().x + " less than L1E: " + l2.getP2().x);
+                    if (l2.getP1().x < l1.getP2().x) {
+                        //AND
+                        System.out.println("2.2: Comparing L2S: " + l2.getP1().x + " larger than L1S: " + l1.getP1().x);
+                        if (l2.getP1().x > l1.getP1().x) {
+                            System.out.println("2: Success");
+                            //IT IS INTERSECTED
+                            //continue;
+                        }
+                        else {
+                            //FAILED SECOND COMPARISON
+                            System.out.println("2: Fail");
+                            //return false;
+                        }
+                    }
+                    else {
+                        System.out.println("Failed second comparison RETURN FALSE");
+                        return false;
+                    }
+                    //return false;
+                }
+                else{
+                    System.out.println("NEITHER RETURN FALSE");
+                    return false;
+                }
+  */
+
+import org.opencv.core.*;
+import org.opencv.core.Point;
+import org.opencv.highgui.HighGui;
+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 java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import javax.imageio.ImageIO;
+
+//REFERENCES:
+//https://docs.opencv.org/3.4.3/d9/db0/tutorial_hough_lines.
+//https://stackoverflow.com/questions/43443309/count-red-pixel-in-a-given-image
+//https://www.wikihow.com/Calculate-Percentage-in-Java
+//https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+//https://beginnersbook.com/2013/12/java-arraylist-of-object-sort-example-comparable-and-comparator/
+//https://www.programiz.com/java-programming/examples/standard-deviation
+//https://www.geeksforgeeks.org/how-to-remove-duplicates-from-arraylist-in-java/
+//https://stackoverflow.com/questions/7988486/how-do-you-calculate-the-variance-median-and-standard-deviation-in-c-or-java/7988556
+//https://stackoverflow.com/questions/10396970/sort-a-list-that-contains-a-custom-class
+//https://stackoverflow.com/questions/37946482/crop-images-area-with-opencv-java
+//https://docs.opencv.org/3.4/dd/dd7/tutorial_morph_lines_detection.html
+
+
+
+//GOAL for 21st
+
+
+//Classifier 01
+//Have args so can call "java image-identification-classifier01 XX XX"
+//args can be parameters in algorthim such as threshold or theta?
+//Run on 5000 images.
+//Record success rates
+//All done with makefile
+
+
+//But first understand houghline transform
+//Know what the algorithm being used is doing.
+//MAke constants for this classifier
+//Make java be able to run on CMD line
+
+public class MainMorph {
+    //GLOBAL_CONSTANTS
+
+    static double THRESHOLD_C = 4;
+
+
+    //
+    static class StartAndEndPoint {
+        //PRIVATES
+        private Point _p1;
+        private Point _p2;
+        //CONSTRUCTOR
+        public StartAndEndPoint(Point p1, Point p2){
+            _p1 = p1;
+            _p2 = p2;
+        }
+        //GETTERS
+        public Point getP1(){
+            return _p1;
+        }
+        public Point getP2(){
+            return  _p2;
+        }
+        //SETTERS
+        public void setP1(Point p1){
+            _p1 = p1;
+        }
+        public void setP2(Point p2){
+            _p2 = p2;
+        }
+
+        //ToString
+        public  String toString(){
+            return "Start: " + _p1 + " End: " + _p2;
+        }
+
+    }
+    private static  BufferedImage toBufferedImage(Mat mat){
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+        try{
+            int type = BufferedImage.TYPE_3BYTE_BGR;
+            int bufferSize = mat.channels() * mat.cols() * mat.rows();
+            byte[] b = new byte[bufferSize];
+            //get all the pixels
+            mat.get(0, 0, b);
+            BufferedImage image = new BufferedImage(mat.cols(), mat.rows(), type);
+            final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+            System.arraycopy(b, 0, targetPixels, 0, b.length);
+            return image;
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+        return null;
+    }
+
+    private static void showWaitDestroy(String winname, Mat img) {
+        HighGui.imshow(winname, img);
+        HighGui.moveWindow(winname, 500, 0);
+        HighGui.waitKey(0);
+        HighGui.destroyWindow(winname);
+    }
+    //MAIN
+    public static void main(String[] args) {
+
+        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+
+        try {
+            ArrayList<StartAndEndPoint> pointArrayList = new ArrayList<>();
+
+            //Variables
+            Mat edgesDetected = new Mat();
+            Mat mid = new Mat();
+            Mat edgesDetectedRGB = new Mat();
+            Mat clustersFoundRGB = new Mat();
+            String directory = "/Scratch/cpb16/is-sheet-music-encore/download-images/MU/";
+            String hiresDirectory = "/Scratch/cpb16/is-sheet-music-encore/hires-download-images/";
+
+            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //mdp.39015097852365-2.png 176 lines    Contents page.
+            //mdp.39015097852555-3.png 76  lines
+            //!!!!!!!!!!!!!!!!!!!!!!!!!!!NOTNOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //coo.31924062612282-9.png 8   lines
+            //String default_file = directory+"NotSheetMusic/coo.31924062612282-9.png";
+            //String default_file = directory+"NotSheetMusic/mdp.39015097852365-2.png";
+            //String default_file ="TestImages/NotNot/mdp.39015080972303-3.png";
+            //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t2q53nq6w-6.png";
+              String default_file = "/Scratch/cpb16/is-sheet-music-encore/image-identification-terminal/TestImages/test-coo.31924062612282-9.png";
+            //String default_file =hiresDirectory+"BK/NotSheetMusic/aeu.ark+=13960=t9z03w65z-4.png";
+
+            //System.out.println(default_file);
+            //String default_file = "TestImages/NotSheetMusic01.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
+            Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            // Edge detection
+            
+            Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, THRESHOLD_C);
+            //TEST PARAMETERSImgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 531,1);
+
+
+
+            //****************MORPHOLOGY****************************************************************************************
+            //ADDIOTIONAL FILTERING TO STOP STREAKS
+            //LOOK INTO STREAKS MORPHOGOLY.
+            //****************MORPHOLOGY****************************************************************************************
+
+            //Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(4,8));
+            //Imgproc.morphologyEx(original, mid, Imgproc.MORPH_OPEN, kernel);
+            //Imgproc.adaptiveThreshold(mid, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV, 15, 2);
+
+            // Create the images that will use to extract the horizontal and vertical lines
+            Mat horizontal = original.clone();
+            Mat vertical = original.clone();
+            // Specify size on horizontal axis
+            int horizontal_size = horizontal.cols() / 30;
+            // Create structure element for extracting horizontal lines through morphology operations
+            Mat horizontalStructure = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(horizontal_size,1));
+            // Apply morphology operations
+            Imgproc.erode(horizontal, horizontal, horizontalStructure);
+            Imgproc.dilate(horizontal, horizontal, horizontalStructure);
+            // Show extracted horizontal lines
+            showWaitDestroy("horizontal" , horizontal);
+            // Specify size on vertical axis
+            int vertical_size = vertical.rows() / 30;
+            // Create structure element for extracting vertical lines through morphology operations
+            Mat verticalStructure = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size( 1,vertical_size));
+            // Apply morphology operations
+            Imgproc.erode(vertical, vertical, verticalStructure);
+            Imgproc.dilate(vertical, vertical, verticalStructure);
+            // Show extracted vertical lines
+            showWaitDestroy("vertical", vertical);
+            // Inverse vertical image
+            Core.bitwise_not(vertical, vertical);
+            showWaitDestroy("vertical_bit" , vertical);
+            // Extract edges and smooth image according to the logic
+            // 1. extract edges
+            // 2. dilate(edges)
+            // 3. src.copyTo(smooth)
+            // 4. blur smooth img
+            // 5. smooth.copyTo(src, edges)
+            // Step 1
+            Mat edges = new Mat();
+            Imgproc.adaptiveThreshold(vertical, edges, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 3, -2);
+            showWaitDestroy("edges", edges);
+            // Step 2
+            Mat kernel = Mat.ones(2, 2, CvType.CV_8UC1);
+            Imgproc.dilate(edges, edges, kernel);
+            showWaitDestroy("dilate", edges);
+            // Step 3
+            Mat smooth = new Mat();
+            vertical.copyTo(smooth);
+            // Step 4
+            Imgproc.blur(smooth, smooth, new Size(2, 2));
+            // Step 5
+            smooth.copyTo(vertical, edges);
+            // Show final result
+            showWaitDestroy("smooth - final", vertical);
+            System.exit(0);
+
+
+
+
+            //****************MORPHOLOGY****************************************************************************************
+
+            BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGB);
+
+
+            //Display Results
+            //HighGui.imshow("Source", original);
+            //HighGui.imshow("Just Edges", justEdges); //TESTING
+
+
+            HighGui.imshow("LINESFOUND", edgesDetectedRGB);
+            HighGui.resizeWindow("LINESFOUND", 1000,1000);
+            
+            //HighGui.imshow("CLUSTERS FOUND", clustersFoundRGB);
+            //HighGui.imshow("Detected Lines (in red) - negative", edgesDetectedRGBProb);
+
+            //COUNT OF LINES CLASSIFICATION
+            //System.out.println("LINE CLUSTER RESULT: " +  ClassifierLineClusterOLD(toBeClassifiedImg).get(0) + '\t' + "LinesFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(1) + '\t' + "ClustersFound: " + ClassifierLineClusterOLD(toBeClassifiedImg).get(2));
+            //System.out.println("NEW CLUSTER RESULTS: " +  ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(0) + '\t' + "LinesFound: " + horizontalLineCount + '\t' + "ClustersFound: " + ClassifierLineClusterPt(pointArrayList,clustersFoundRGB).get(1));
+            //System.out.println(ClassifierLineClusterPt(pointArrayList, clustersFoundRGB));
+
+            //System.out.println("TEST: " + LineCountOrCluster(horizontalLineCount, pointArrayList, clustersFoundRGB));
+
+            // Wait and Exit
+            HighGui.waitKey();
+            System.exit(0);
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+    }
+}
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/terminalImageClassifier.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/terminalImageClassifier.java	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/image-identification-development/terminalImageClassifier.java	(revision 33415)
@@ -0,0 +1,178 @@
+import org.opencv.core.*;
+import org.opencv.core.Point;
+import org.opencv.highgui.HighGui;
+import org.opencv.imgcodecs.Imgcodecs;
+import org.opencv.imgproc.Imgproc;
+import static org.opencv.imgcodecs.Imgcodecs.imwrite;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferByte;
+import java.io.File;
+import javax.imageio.ImageIO;
+
+//REFERENCES:
+//https://docs.opencv.org/3.4.3/d9/db0/tutorial_hough_lines.
+//https://stackoverflow.com/questions/43443309/count-red-pixel-in-a-given-image
+//https://www.wikihow.com/Calculate-Percentage-in-Java
+//https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+
+
+
+//GOAL for 21st
+
+
+//Classifier 01
+//Have args so can call "java image-identification-classifier01 XX XX"
+//args can be parameters in algorthim such as threshold or theta?
+//Run on 5000 images.
+//Record success rates
+//All done with makefile
+
+
+//But first understand houghline transform
+//Know what the algorithm being used is doing.
+//MAke constants for this classifier
+//Make java be able to run on CMD line
+
+public class terminalImageClassifier {
+
+    //GLOBAL_CONSTANTS
+    //SHOULD TURN INTO ARGS
+
+    private static  BufferedImage toBufferedImage(Mat mat){
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        //https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+        try{
+            int type = BufferedImage.TYPE_3BYTE_BGR;
+            int bufferSize = mat.channels() * mat.cols() * mat.rows();
+            byte[] b = new byte[bufferSize];
+            //get all the pixels
+            mat.get(0, 0, b);
+            BufferedImage image = new BufferedImage(mat.cols(), mat.rows(), type);
+            final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+            System.arraycopy(b, 0, targetPixels, 0, b.length);
+            return image;
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+        return null;
+    }
+
+    private static boolean Classifier(BufferedImage img){
+        try {
+            //Read file
+            //BufferedImage img = ImageIO.read(new File(processedFile));
+            int x = img.getWidth();
+            int y = img.getHeight();
+            int pixelCount  = 0;
+            int redCount    = 0;
+            float percentage = 0;
+
+            //Go Thru every pixel
+            for(int i=0; i < y; i++){
+                for(int j=0;j < x; j++){
+                    //Get value for current pixels RGB value
+                    int currPixelRGB = img.getRGB(j, i);
+                    //Check if pixel is red (hex value of red)
+                    if(currPixelRGB == 0xFFFF0000){
+                        redCount++;
+                    }
+                    pixelCount++;
+                }
+            }
+            //Calculate percentage of Red in image
+            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!!
+                return true;}
+        }
+        catch (Exception e) {
+            System.err.println(e);
+        }
+        return false;
+    }
+
+    public static void main(String[] args) {
+        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+        try {
+            //Variables
+            Mat edgesDetected = new Mat();
+            Mat edgesDetectedRGB = new Mat();
+            Mat edgesDetectedRGBProb;
+            Mat justEdges; //TESTING
+            String default_file = "Test02.png";
+            String filename = ((args.length > 0) ? args[0] : default_file);
+
+            // Load an image
+            Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            // Edge detection
+            Imgproc.Canny(original, edgesDetected, 50, 200, 3, false);
+            //Copy edges to the images that will display the results in BGR
+            Imgproc.cvtColor(edgesDetected, edgesDetectedRGB, Imgproc.COLOR_GRAY2BGR);
+            edgesDetectedRGBProb = edgesDetectedRGB.clone();
+
+            justEdges = edgesDetectedRGBProb.clone();//TESTING
+
+            // Standard Hough Line Transform
+            Mat lines = new Mat(); // will hold the results of the detection
+            //(edgeDetectedImage, outputOfDetection(r,Îž), resolution of r, resolution of Îž, threshold (minimum num of intersections)
+            Imgproc.HoughLines(edgesDetected, lines, 1.4, Math.PI / 180, 500); // runs the actual detection
+
+            // Draw the lines
+            //LOOK OVER THIS AGAIN THE 1000 might be image height?
+            //THRESHOLD should be changed, based on img dimensions?
+
+            for (int x = 0; x < lines.rows(); x++) {
+                double rho = lines.get(x, 0)[0],
+                        theta = lines.get(x, 0)[1];
+                //CONVERT to Cartisean coord
+                double a = Math.cos(theta), b = Math.sin(theta);
+                double x0 = a * rho, y0 = b * rho;
+
+                Point pt1 = new Point(Math.round(x0 + 1000 * (-b)), Math.round(y0 + 1000 * (a)));
+                Point pt2 = new Point(Math.round(x0 - 1000 * (-b)), Math.round(y0 - 1000 * (a)));
+                Imgproc.line(edgesDetectedRGB, pt1, pt2, new Scalar(0, 0, 255), 3, Imgproc.LINE_AA, 0);
+            }
+
+            // Probabilistic Line Transform
+            Mat linesP = new Mat(); // will hold the results of the detection
+            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 180, 50, 50, 10); // runs the actual detection
+            // Draw the lines
+            for (int x = 0; x < linesP.rows(); x++) {
+                double[] l = linesP.get(x, 0);
+                Imgproc.line(edgesDetectedRGBProb, new Point(l[0], l[1]), new Point(l[2], l[3]), new Scalar(0, 0, 255), 3, Imgproc.LINE_AA, 0);
+            }
+
+            //Convert MAT into a BufferedImage
+            BufferedImage toBeClassifiedImg = toBufferedImage(edgesDetectedRGBProb);
+
+            //Calculate if its sheet music or not
+            Boolean isSheetMusic = Classifier(toBeClassifiedImg);
+            System.out.println("Filename: " + filename + "  Status: " + isSheetMusic);
+
+            //Save Processed Image
+            String processedFile = null;
+            if (isSheetMusic == true) {
+                //NEED FIGURE OUT HOW RUN IN SCRIPT. THEN USE ARGS as filename + "HoughLineP + "png"
+                processedFile = "SheetMusic/Test_HoughLineP.png";
+            }else {
+                processedFile = "Test_HoughLineP.png";
+            }
+            imwrite(processedFile, edgesDetectedRGBProb);
+
+            //Display Results
+            //HighGui.imshow("Source", original);
+            HighGui.imshow("Just Edges", justEdges); //TESTING
+            HighGui.imshow("Detected Lines (in red) - Standard Hough Line Transform", edgesDetectedRGB);
+            //HighGui.imshow("Detected Lines (in red) - Probabilistic Line Transform", edgesDetectedRGBProb);
+
+            // Wait and Exit
+            HighGui.waitKey();
+            System.exit(0);
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+    }
+}
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/description.html
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/description.html	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/description.html	(revision 33415)
@@ -0,0 +1,1 @@
+<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/encodings.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/encodings.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/encodings.xml	(revision 33415)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/misc.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/misc.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/misc.xml	(revision 33415)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="ProjectKey">
+    <option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/modules.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/modules.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/modules.xml	(revision 33415)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/image-identification.iml" filepath="$PROJECT_DIR$/image-identification.iml" />
+    </modules>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/project-template.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/project-template.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/project-template.xml	(revision 33415)
@@ -0,0 +1,3 @@
+<template>
+  <input-field default="com.company">IJ_BASE_PACKAGE</input-field>
+</template>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/vcs.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/vcs.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/vcs.xml	(revision 33415)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="svn" />
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/workspace.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/workspace.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/.idea/workspace.xml	(revision 33415)
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="9bad4f92-4a7d-46a2-b6f0-94214c9f55cc" name="Default" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" />
+    </list>
+    <ignored path="$PROJECT_DIR$/out/" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="CoverageDataManager">
+    <SUITE FILE_PATH="coverage/image_identification_development$Main.ic" NAME="Main Coverage Results" MODIFIED="1562975922003" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
+  </component>
+  <component name="FindInProjectRecents">
+    <findStrings>
+      <find>aeu.ark+=13960=t93787r1w-10.png</find>
+      <find>returnArray</find>
+    </findStrings>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java" />
+        <option value="$PROJECT_DIR$/src/Main.java" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds" extendedState="6">
+    <option name="x" value="562" />
+    <option name="y" value="24" />
+    <option name="width" value="908" />
+    <option name="height" value="996" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane" />
+      <pane id="PackagesPane" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="GenerateAntBuildDialog.backupFiles" value="true" />
+    <property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" />
+    <property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
+    <property name="GenerateAntBuildDialog.generateSingleFile" value="true" />
+    <property name="GenerateAntBuildDialog.outputFileNameProperty" value="image-identification" />
+    <property name="full.screen.before.presentation.mode" value="false" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+    <property name="project.structure.last.edited" value="Modules" />
+    <property name="project.structure.proportion" value="0.15" />
+    <property name="project.structure.side.proportion" value="0.2" />
+    <property name="run.code.analysis.last.selected.profile" value="pProject Default" />
+    <property name="settings.editor.selected.configurable" value="editor.preferences.fonts.default" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager">
+    <configuration name="Main" type="Application" factoryName="Application" temporary="true">
+      <option name="MAIN_CLASS_NAME" value="Main" />
+      <module name="image-identification" />
+      <option name="VM_PARAMETERS" value="-Djava.library.path=$PROJECT_DIR$/../../opencv-3.4.2/build/lib" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <RunnerSettings RunnerId="Run" />
+      <ConfigurationWrapper RunnerId="Run" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Application.Main" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SvnConfiguration" cleanupOnStartRun="true">
+    <configuration>$USER_HOME$/.subversion</configuration>
+    <supportedVersion>125</supportedVersion>
+  </component>
+  <component name="SvnFileUrlMappingImpl">
+    <option name="myMappingRoots">
+      <list>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$" />
+        </SvnCopyRootSimple>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$/.idea" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$/.idea" />
+        </SvnCopyRootSimple>
+      </list>
+    </option>
+    <option name="myMoreRealMappingRoots">
+      <list>
+        <SvnCopyRootSimple>
+          <option name="myVcsRoot" value="$PROJECT_DIR$" />
+          <option name="myCopyRoot" value="$PROJECT_DIR$" />
+        </SvnCopyRootSimple>
+      </list>
+    </option>
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="9bad4f92-4a7d-46a2-b6f0-94214c9f55cc" name="Default" comment="" />
+      <created>1557697736662</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1557697736662</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="67" y="25" width="1613" height="1025" extended-state="6" />
+    <layout>
+      <window_info id="Designer" order="0" />
+      <window_info id="UI Designer" order="1" />
+      <window_info id="Capture Tool" order="2" />
+      <window_info id="Favorites" order="3" side_tool="true" />
+      <window_info id="Image Layers" order="4" />
+      <window_info active="true" content_ui="combo" id="Project" order="5" visible="true" weight="0.18379068" />
+      <window_info id="Structure" order="6" side_tool="true" weight="0.25" />
+      <window_info anchor="bottom" id="Terminal" order="0" weight="0.42638037" />
+      <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
+      <window_info anchor="bottom" id="Version Control" order="2" />
+      <window_info anchor="bottom" id="Messages" order="3" weight="0.32719836" />
+      <window_info anchor="bottom" id="Message" order="4" />
+      <window_info anchor="bottom" id="Find" order="5" weight="0.32924336" />
+      <window_info anchor="bottom" id="Run" order="6" weight="0.20245399" />
+      <window_info anchor="bottom" id="Debug" order="7" weight="0.24437627" />
+      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="10" />
+      <window_info anchor="bottom" id="Inspection Results" order="11" weight="0.32924336" />
+      <window_info anchor="right" id="Maven" />
+      <window_info anchor="right" id="Capture Analysis" order="0" />
+      <window_info anchor="right" id="Palette&#9;" order="1" />
+      <window_info anchor="right" id="Theme Preview" order="2" />
+      <window_info anchor="right" id="Maven Projects" order="3" />
+      <window_info anchor="right" id="Palette" order="4" />
+      <window_info anchor="right" id="Coverage" order="5" side_tool="true" weight="0.32991913" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="6" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="7" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="8" weight="0.25" />
+    </layout>
+    <layout-to-restore>
+      <window_info id="Designer" order="0" />
+      <window_info id="UI Designer" order="1" />
+      <window_info id="Capture Tool" order="2" />
+      <window_info id="Favorites" order="3" side_tool="true" />
+      <window_info id="Image Layers" order="4" />
+      <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" />
+      <window_info anchor="bottom" id="Terminal" order="0" />
+      <window_info anchor="bottom" id="Event Log" order="1" side_tool="true" />
+      <window_info anchor="bottom" id="Version Control" order="2" />
+      <window_info anchor="bottom" id="Messages" order="3" />
+      <window_info anchor="bottom" id="Message" order="4" />
+      <window_info anchor="bottom" id="Find" order="5" weight="0.32924336" />
+      <window_info anchor="bottom" id="Run" order="6" visible="true" weight="0.34662578" />
+      <window_info anchor="bottom" id="Debug" order="7" weight="0.4" />
+      <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="10" />
+      <window_info anchor="right" id="Capture Analysis" order="0" />
+      <window_info anchor="right" id="Palette&#9;" order="1" />
+      <window_info anchor="right" id="Theme Preview" order="2" />
+      <window_info anchor="right" id="Maven Projects" order="3" />
+      <window_info anchor="right" id="Palette" order="4" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="5" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="6" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="7" weight="0.25" />
+    </layout-to-restore>
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="jar://$PROJECT_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/org/opencv/core/Mat.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/Object.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/jre/lib/rt.jar!/sun/misc/Launcher.class" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/jre/lib/rt.jar!/sun/instrument/InstrumentationImpl.class" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/ClassLoader.java" />
+    <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/net/URLClassLoader.java" />
+    <entry file="file://$PROJECT_DIR$/../image-identification-terminal/javaImageClassifier.java" />
+    <entry file="file://$PROJECT_DIR$/src/Main.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="399">
+          <caret line="812" column="12" lean-forward="true" selection-start-line="812" selection-start-column="12" selection-end-line="812" selection-end-column="12" />
+          <folding>
+            <element signature="imports" expanded="true" />
+            <element signature="class#StartAndEndPoint#0;class#Main#0" />
+            <element signature="e#5318#5319#0" expanded="true" />
+            <element signature="e#5352#5353#0" expanded="true" />
+            <element signature="method#removeDuplicates#0;class#Main#0" />
+            <element signature="method#StandardDeviation#0;class#Main#0" />
+            <element signature="method#VarianceCalc#0;class#Main#0" />
+            <element signature="method#lineComparison#0;class#Main#0" />
+            <element signature="method#ClusterCheck#0;class#Main#0" />
+            <element signature="method#toBufferedImage#0;class#Main#0" />
+            <element signature="method#ClassifierPixelCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineCount#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterOLD#0;class#Main#0" />
+            <element signature="method#ClassifierLineCluster#0;class#Main#0" />
+            <element signature="method#ClassifierLineClusterPt#0;class#Main#0" />
+            <element signature="method#LineCountOrCluster#0;class#Main#0" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ArtifactsStructureConfigurable.UI">
+        <settings>
+          <artifact-editor />
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="FacetStructureConfigurable.UI">
+        <settings>
+          <last-edited>No facets are configured</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="GlobalLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="JdkListConfigurable.UI">
+        <settings>
+          <last-edited>1.8</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ModuleStructureConfigurable.UI">
+        <settings>
+          <last-edited>image-identification</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ProjectLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Makefile	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Makefile	(revision 33415)
@@ -0,0 +1,8 @@
+#https://www.tensorflow.org/install/lang_java
+
+run-Classifier01:
+	javac terminalImageClassifer.java
+	java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ terminalImageClassifier
+
+
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Notes.txt
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Notes.txt	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/Notes.txt	(revision 33415)
@@ -0,0 +1,41 @@
+Houghlines in java.
+Houghlines does detect white lines. Use binary_inv to show with houghlineTest.png
+
+OTSU threshold gives best black and white response
+
+Would it be useful to process what lines have been detected?
+As in, filter out every line detected except for horizontal lines?
+
+BINARYINV seems to be result in a better looking image than canny for sheet music
+
+In houghlines parameters, having resoluation of 1 degree and 1 pixel makes sense. Would allow for sheet music image to be at any orientation.
+Threshold would ideally need to vary dependant on how much sheet music there is.
+Which brings to the table filtering. Having a good filter that eliminates noise leaves the sheet music free would be good. The binary inv would be suitable, since houghlines detect white lines.
+Need filter to denoize image. OTSU seems to do a good job.
+
+The threshold would need to be adjusted dependant on how many white pixels there are.
+houghlinesP has start and end points. where houghlines does not. Which is why houghlinesP performs better on a set of images becuz of the end points rather than just "a line must meet a certain threshold at that coordinate for it to be registered"
+Houghlines in order to be effetive must be scaled to suit the image.
+
+HoughlinesP contains this:
+minLinLength: The minimum number of points that can form a line. Lines with less than this number of points are disregarded.
+maxLineGap: The maximum gap between two points to be considered in the same line.
+
+____ _____     ______ 	______
+
+HoughlinesP can calculate on a local scale, comaparing the distance between just the gap in the line.
+Houghlines  only calculates on the lines scale, checking the whole lines point count(attenuator?) reaching over the threshold.
+
+This means houghlinesP can scale better and allow for more accurate results
+
+
+The mathRound does not make difference
+
+Drawing forloop with cols, seems to be less effective
+Even though it does employ same calculations? 
+https://stackoverflow.com/questions/29493267/how-to-detect-lines-using-houghlines-in-opencv-java
+
+
+
+not enough MP records with more than 10 pages
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.iml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.iml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.iml	(revision 33415)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../opencv-3.4.2/build/bin/opencv-342.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+  </component>
+</module>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.properties
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.properties	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.properties	(revision 33415)
@@ -0,0 +1,4 @@
+path.variable.kotlin_bundled=/opt/idea/plugins/Kotlin/kotlinc
+path.variable.maven_repository=/home/cpb16/.m2/repository
+jdk.home.1.8=/usr/lib/jvm/java-8-oracle
+javac2.instrumentation.includeJavaRuntime=false
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.xml
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.xml	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-dev-02/out/production/image-identification-dev-02/image-identification.xml	(revision 33415)
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="image-identification" default="all">
+  
+  
+  <property file="image-identification.properties"/>
+  <!-- Uncomment the following property if no tests compilation is needed -->
+  <!-- 
+  <property name="skip.tests" value="true"/>
+   -->
+  
+  <!-- Compiler options -->
+  
+  <property name="compiler.debug" value="on"/>
+  <property name="compiler.generate.no.warnings" value="off"/>
+  <property name="compiler.args" value=""/>
+  <property name="compiler.max.memory" value="700m"/>
+  <patternset id="ignored.files">
+    <exclude name="**/*.hprof/**"/>
+    <exclude name="**/*.pyc/**"/>
+    <exclude name="**/*.pyo/**"/>
+    <exclude name="**/*.rbc/**"/>
+    <exclude name="**/*.yarb/**"/>
+    <exclude name="**/*~/**"/>
+    <exclude name="**/.DS_Store/**"/>
+    <exclude name="**/.git/**"/>
+    <exclude name="**/.hg/**"/>
+    <exclude name="**/.svn/**"/>
+    <exclude name="**/CVS/**"/>
+    <exclude name="**/__pycache__/**"/>
+    <exclude name="**/_svn/**"/>
+    <exclude name="**/vssver.scc/**"/>
+    <exclude name="**/vssver2.scc/**"/>
+  </patternset>
+  <patternset id="library.patterns">
+    <include name="*.war"/>
+    <include name="*.swc"/>
+    <include name="*.zip"/>
+    <include name="*.egg"/>
+    <include name="*.ane"/>
+    <include name="*.jar"/>
+    <include name="*.ear"/>
+  </patternset>
+  <patternset id="compiler.resources">
+    <exclude name="**/?*.java"/>
+    <exclude name="**/?*.form"/>
+    <exclude name="**/?*.class"/>
+    <exclude name="**/?*.groovy"/>
+    <exclude name="**/?*.scala"/>
+    <exclude name="**/?*.flex"/>
+    <exclude name="**/?*.kt"/>
+    <exclude name="**/?*.clj"/>
+    <exclude name="**/?*.aj"/>
+  </patternset>
+  
+  <!-- JDK definitions -->
+  
+  <property name="jdk.bin.1.8" value="${jdk.home.1.8}/bin"/>
+  <path id="jdk.classpath.1.8">
+    <fileset dir="${jdk.home.1.8}">
+      <include name="jre/lib/charsets.jar"/>
+      <include name="jre/lib/deploy.jar"/>
+      <include name="jre/lib/ext/cldrdata.jar"/>
+      <include name="jre/lib/ext/dnsns.jar"/>
+      <include name="jre/lib/ext/jaccess.jar"/>
+      <include name="jre/lib/ext/jfxrt.jar"/>
+      <include name="jre/lib/ext/localedata.jar"/>
+      <include name="jre/lib/ext/nashorn.jar"/>
+      <include name="jre/lib/ext/sunec.jar"/>
+      <include name="jre/lib/ext/sunjce_provider.jar"/>
+      <include name="jre/lib/ext/sunpkcs11.jar"/>
+      <include name="jre/lib/ext/zipfs.jar"/>
+      <include name="jre/lib/javaws.jar"/>
+      <include name="jre/lib/jce.jar"/>
+      <include name="jre/lib/jfr.jar"/>
+      <include name="jre/lib/jfxswt.jar"/>
+      <include name="jre/lib/jsse.jar"/>
+      <include name="jre/lib/management-agent.jar"/>
+      <include name="jre/lib/plugin.jar"/>
+      <include name="jre/lib/resources.jar"/>
+      <include name="jre/lib/rt.jar"/>
+    </fileset>
+  </path>
+  
+  <property name="project.jdk.home" value="${jdk.home.1.8}"/>
+  <property name="project.jdk.bin" value="${jdk.bin.1.8}"/>
+  <property name="project.jdk.classpath" value="jdk.classpath.1.8"/>
+  <!-- Register Custom Compiler Taskdefs -->
+  <property name="javac2.home" value="${idea.home}/lib"/>
+  <path id="javac2.classpath">
+    <fileset dir="${javac2.home}">
+      <include name="javac2.jar"/>
+      <include name="jdom.jar"/>
+      <include name="asm-all*.jar"/>
+      <include name="jgoodies-forms.jar"/>
+    </fileset>
+  </path>
+  <target name="register.custom.compilers">
+    <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
+    <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
+  </target>
+  
+  <!-- Modules -->
+  
+  
+  <!-- Module image-identification -->
+  
+  <dirname property="module.image-identification.basedir" file="${ant.file}"/>
+  
+  
+  <property name="module.jdk.home.image-identification" value="${project.jdk.home}"/>
+  <property name="module.jdk.bin.image-identification" value="${project.jdk.bin}"/>
+  <property name="module.jdk.classpath.image-identification" value="${project.jdk.classpath}"/>
+  
+  <property name="compiler.args.image-identification" value="-encoding UTF-8 -source 8 -target 8 ${compiler.args}"/>
+  
+  <property name="image-identification.output.dir" value="${module.image-identification.basedir}/out/production/image-identification"/>
+  <property name="image-identification.testoutput.dir" value="${module.image-identification.basedir}/out/test/image-identification"/>
+  
+  <path id="image-identification.module.bootclasspath">
+    <!-- Paths to be included in compilation bootclasspath -->
+  </path>
+  
+  <path id="image-identification.module.production.classpath">
+    <path refid="${module.jdk.classpath.image-identification}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.runtime.production.module.classpath">
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.module.classpath">
+    <path refid="${module.jdk.classpath.image-identification}"/>
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  <path id="image-identification.runtime.module.classpath">
+    <pathelement location="${image-identification.testoutput.dir}"/>
+    <pathelement location="${image-identification.output.dir}"/>
+    <pathelement location="${basedir}/../../opencv-3.4.2/build/bin/opencv-342.jar"/>
+  </path>
+  
+  
+  <patternset id="excluded.from.module.image-identification">
+    <patternset refid="ignored.files"/>
+  </patternset>
+  
+  <patternset id="excluded.from.compilation.image-identification">
+    <patternset refid="excluded.from.module.image-identification"/>
+  </patternset>
+  
+  <path id="image-identification.module.sourcepath">
+    <dirset dir="${module.image-identification.basedir}">
+      <include name="src"/>
+    </dirset>
+  </path>
+  
+  
+  <target name="compile.module.image-identification" depends="compile.module.image-identification.production,compile.module.image-identification.tests" description="Compile module image-identification"/>
+  
+  <target name="compile.module.image-identification.production" depends="register.custom.compilers" description="Compile module image-identification; production classes">
+    <mkdir dir="${image-identification.output.dir}"/>
+    <javac2 destdir="${image-identification.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.image-identification}/javac">
+      <compilerarg line="${compiler.args.image-identification}"/>
+      <bootclasspath refid="image-identification.module.bootclasspath"/>
+      <classpath refid="image-identification.module.production.classpath"/>
+      <src refid="image-identification.module.sourcepath"/>
+      <patternset refid="excluded.from.compilation.image-identification"/>
+    </javac2>
+    
+    <copy todir="${image-identification.output.dir}">
+      <fileset dir="${module.image-identification.basedir}/src">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+      </fileset>
+    </copy>
+  </target>
+  
+  <target name="compile.module.image-identification.tests" depends="register.custom.compilers,compile.module.image-identification.production" description="compile module image-identification; test classes" unless="skip.tests"/>
+  
+  <target name="clean.module.image-identification" description="cleanup module">
+    <delete dir="${image-identification.output.dir}"/>
+    <delete dir="${image-identification.testoutput.dir}"/>
+  </target>
+  
+  <target name="init" description="Build initialization">
+    <!-- Perform any build initialization in this target -->
+  </target>
+  
+  <target name="clean" depends="clean.module.image-identification" description="cleanup all"/>
+  
+  <target name="build.modules" depends="init, clean, compile.module.image-identification" description="build all modules"/>
+  
+  <target name="all" depends="build.modules" description="build all"/>
+</project>
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile	(revision 33414)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/Makefile	(revision 33415)
@@ -18,15 +18,20 @@
 	rm results.txt
 
-testrun-classifier-cluster-single:
-	javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaImageClassifier.java;
-	./runClassifier.sh TestImages/test-coo.31924062612282-9.png cluster test.png -single
+testrun-classifier-single-cluster:
+	./runClassifer.sh TestImages/test-coo.31924062612282-9.png cluster logSingle.txt -singleNew	
 	echo "Displaying javaImageClassifier output"
-        #Display output of javaImageClassifier
-	less log.txt
         #Calculate the Accuracy of the classifier
-	java javaAccuracyCalculator log.txt houghlinesP results.txt
+	java javaAccuracyCalculator logSingle.txt houghlinesP resultSingle.txt
         #Display output
-	less results.txt
-	rm log.txt
-	rm results.txt
+	less resultSingle.txt
+	less logSingle.txt
 
+testrun-classifier-single-count:
+	./runClassifer.sh TestImages/test-coo.31924062612282-9.png count logSingle.txt -singleNew
+	echo "Displaying javaImageClassifier output"
+        #Calculate the Accuracy of the classifier
+	java javaAccuracyCalculator logSingle.txt houghlinesP resultSingle.txt
+        #Display output
+	less logSingle.txt
+
+
Index: /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java
===================================================================
--- /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java	(revision 33415)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaClassifierComparison.java	(revision 33415)
@@ -0,0 +1,408 @@
+
+import org.opencv.core.*;
+import org.opencv.core.Point;
+import org.opencv.highgui.HighGui;
+import org.opencv.imgcodecs.Imgcodecs;
+import org.opencv.imgproc.Imgproc;
+import static org.opencv.imgcodecs.Imgcodecs.imwrite;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferByte;
+//import java.io.File;
+//import java.io.BufferedWriter;
+//import java.io.FileWriter;
+import javax.imageio.ImageIO;
+//import java.util.logging.Logger;
+//import java.util.ArrayList;
+//import java.util.Collections.*;
+import java.util.*;
+import java.lang.*;
+import java.io.*;
+
+//REFERENCES:
+//https://docs.opencv.org/3.4.3/d9/db0/tutorial_hough_lines.
+//https://stackoverflow.com/questions/43443309/count-red-pixel-in-a-given-image
+//https://www.wikihow.com/Calculate-Percentage-in-Java
+//https://riptutorial.com/opencv/example/21963/converting-an-mat-object-to-an-bufferedimage-object
+//https://stackoverflow.com/questions/15758685/how-to-write-logs-in-text-file-when-using-java-util-logging-logger
+//https://stackoverflow.com/questions/9961292/write-to-text-file-without-overwriting-in-java
+//https://alvinalexander.com/java/edu/pj/pj010005
+//https://stackoverflow.com/questions/8557716/how-to-return-multiple-values
+
+//OUTPUT OF THIS JAVA PROGRAM FOUND IN log.txt
+//Each image processed will have an output of
+//True  =classifierType + 1 + Filename + Status
+//False =classifierType + 0 + Filename + Status
+public class javaClassifierComparison {
+    //GLOBALS Constants
+    static int CLASSIFIER_HOUGHLINESP_MIN = 10;
+    static int CLASSIFIER_HOUGHLINESP_MAX = 65;
+    static int HOUGHLINEP_THRESHOLD = 10;
+    static int STANDARD_DEVIATION_THRESHOLD = 6;
+    static int MINLINECOUNT = 40;
+    static int MAXLINEGAP = 1;
+    static double THRESHOLD_C               = 4;
+    static double SLOPEGRADIENT = 0.02;
+    static double CLUSTER_DISTANCE_MAX = 40;
+    static double CLUSTER_DISTANCE_MIN = 2;
+
+
+    static public class StartAndEndPoint {
+        //PRIVATES
+        private Point _p1;
+        private Point _p2;
+
+        //CONSTRUCTOR
+        public StartAndEndPoint(Point p1, Point p2) {
+            _p1 = p1;
+            _p2 = p2;
+        }
+
+        //GETTERS
+        public Point getP1() {
+            return _p1;
+        }
+
+        public Point getP2() {
+            return _p2;
+        }
+
+        //SETTERS
+        public void setP1(Point p1) {
+            _p1 = p1;
+        }
+
+        public void setP2(Point p2) {
+            _p2 = p2;
+        }
+
+        //ToString
+        public String toString() {
+            return "Start: " + _p1 + " End: " + _p2;
+        }
+    }
+    static public class Pair{
+        //Privates
+        private Boolean _b;
+        private Integer _i;
+
+        //Constructor
+        public Pair(Boolean b, Integer i){
+            _b = b;
+            _i = i;
+        }
+        public  Pair(){
+            _b = null;
+            _i = null;
+        }
+
+        //Getters
+        public Boolean getBoolean() {return _b;}
+        public Integer getInteger() {return _i;}
+
+        //Setters
+        public void setBoolean (Boolean b){_b = b;}
+        public void setInteger (Integer i){_i = i;}
+
+        //ToString
+        public String toString() {return  "Boolean: " + _b + " Integer: " + _i;}
+    }
+
+    public static void main(String[] args) {
+        try {
+            if (args.length != 3) {
+                System.out.println("Usage: imageClassifier <inputFilename> <classifierType> <outputFilename>");
+            } else {
+                Pair houghlinesPResult = new Pair();
+
+                Boolean result = null;
+                String result_cluster = "";
+                String imageFilename = args[0];
+                String classifierType = args[1];
+                String outputFilename = args[2];
+                Boolean enableLineClustering = null;
+                //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 "count":
+                        enableLineClustering = false;
+                        houghlinesPResult = Algorithm_HoughLinesP(imageFilename, enableLineClustering);
+                        bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + houghlinesPResult.getBoolean() + '\t' + "Number of lines:" + '\t' + houghlinesPResult.getInteger() + '\t' + classifierType + '\n');
+                        break;
+                    case "cluster":
+                        enableLineClustering = true;
+                        houghlinesPResult = Algorithm_HoughLinesP(imageFilename, enableLineClustering);
+                        bw.write("Filename:" + '\t' + imageFilename + '\t' + "Classified as:" + '\t' + houghlinesPResult.getBoolean() + '\t' + "Number of lines:" + '\t' + houghlinesPResult.getInteger() + '\t' + classifierType + '\n');
+                        break;
+                    case "morphology":
+                        //result_cluster = setup_Cluster(imageFilename);
+                        //bw.write(result_cluster);
+                        break;
+                    default:
+                        System.out.println("unknown algorithm");
+                        break;
+                }
+
+                bw.close();
+            }
+        } catch (Exception e) {
+            System.err.println(e);
+        }
+    }
+
+    //******************
+    //ALGORITHM FUNCTIONS
+    //******************
+    private static Pair Algorithm_HoughLinesP(String filename, Boolean enableLineClusterDetection){
+        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+        Boolean isSheetMusic = null;
+        Pair returnVariables = new Pair();
+        try{
+            //Variables
+            int horizontalLineCount =0;
+            Mat edgesDetected = new Mat();
+            Mat edgesDetectedRGB = new Mat();
+            Mat edgesExtra = new Mat();
+            Mat edgesDetectedRGBProb;
+            ArrayList<StartAndEndPoint> pointArrayList = new ArrayList<>();
+
+            //****************EXPLANATION**************************************************
+            //
+            //Load an image in greyscale
+            //Additional matrix to hold results of line detection
+            //Inversed Binarization of image
+            //Detect lines in image
+            //Go thru every line detected and check its gradient is less than SLOPEGRADIENT
+            //
+            //****************EXPLANATION**************************************************
+
+            Mat original = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
+            Mat linesP = new Mat(); //will hold the results of the detection
+            Imgproc.adaptiveThreshold(original, edgesDetected,255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,Imgproc.THRESH_BINARY_INV,15, THRESHOLD_C);
+            double minLineLength = edgesDetected.size().width/8;
+            Imgproc.HoughLinesP(edgesDetected, linesP, 1, Math.PI / 720, HOUGHLINEP_THRESHOLD, minLineLength, MAXLINEGAP);
+            for (int x = 0; x < linesP.rows(); x++) {
+                double[] l = linesP.get(x, 0);
+                Point p1 = new Point(l[0], l[1]);
+                Point p2 = new Point(l[2], l[3]);
+                double m = Math.abs(p2.y - p1.y)/(p2.x - p1.x);
+                if(m<SLOPEGRADIENT) {
+                    horizontalLineCount++;
+                    pointArrayList.add(new StartAndEndPoint(p1, p2));
+                }
+            }
+
+            //Calculate if its sheet music or not
+            if(enableLineClusterDetection ==true){returnVariables = Classifier_ClusterDetection(pointArrayList);}
+            else {
+                isSheetMusic = Classifier_LineCounter(horizontalLineCount);
+                returnVariables.setBoolean(isSheetMusic);
+                returnVariables.setInteger(horizontalLineCount);
+            }
+        }
+        catch(Exception e){
+            System.err.println(e);
+        }
+        return returnVariables;
+    }
+
+    //******************
+    //CLASSIFIER FUNCTIONS
+    //******************
+
+    private static boolean Classifier_LineCounter(int lineCount){
+        if(lineCount>MINLINECOUNT){return true;}
+        else{return false;}
+    }
+    private static Pair Classifier_ClusterDetection(ArrayList<StartAndEndPoint> linePointsArray){
+
+        Pair returnPair = new Pair();
+        ArrayList<StartAndEndPoint> closeLinePts = new ArrayList<StartAndEndPoint>();
+        ArrayList<StartAndEndPoint[]> clusterPtArray = new ArrayList<StartAndEndPoint[]>();
+        int clusterCount = 0;
+        try {
+
+            if(linePointsArray.size()> 1) {
+                for (int i = 0; i < linePointsArray.size(); i++){
+                    for (int j = 0; j < linePointsArray.size(); j++) {
+                        if(Math.abs(linePointsArray.get(j).getP1().y - linePointsArray.get(i).getP1().y) < 5){
+                            if(linePointsArray.get(j).getP1().y != linePointsArray.get(i).getP1().y){
+                                closeLinePts.add(linePointsArray.get(i));
+                            }
+                        }
+                    }
+                }
+
+                Collections.sort(closeLinePts, new Comparator<StartAndEndPoint>() {
+                    @Override
+                    public int compare(StartAndEndPoint p1, StartAndEndPoint p2) {
+                        return (int)(p1.getP1().y - p2.getP1().y);
+                    }
+                });
+
+                closeLinePts = removeDuplicates(closeLinePts);
+
+                if(closeLinePts.size() >= 4) {
+                    for(int i= 0; i < closeLinePts.size(); i++){
+                        if(i + 4 >= closeLinePts.size()){
+                            break;
+                        }
+                        else{
+                            StartAndEndPoint[] tempPtArray = new StartAndEndPoint[4];
+                            tempPtArray[0] = closeLinePts.get(i);
+                            tempPtArray[1] = closeLinePts.get(i + 1);
+                            tempPtArray[2] = closeLinePts.get(i + 2);
+                            tempPtArray[3] = closeLinePts.get(i + 3);
+                            if(ClusterCheck(tempPtArray)){
+                                clusterPtArray.add(tempPtArray);
+                                if((i + 4 < closeLinePts.size())){
+                                    i = i+4;
+                                }
+                                else{
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+
+ /*               for(StartAndEndPoint pt : linePointsArray){
+                    for(int i =0; i < clusterPtArray.size(); i++){
+                        for(StartAndEndPoint item : clusterPtArray.get(i)) {
+                            if (item.getP1().y == pt.getP1().y){
+                                Imgproc.line(clustersFoundRGB, pt.getP1(), pt.getP2(), new Scalar(0, 255, 0), 1, Imgproc.LINE_4, 0);
+                            }
+                        }
+                    }
+                }*/
+
+                clusterCount = clusterPtArray.size();
+                //SETUP RETURN ARRAY
+                if(clusterCount >= 1){
+                    returnPair.setBoolean(true);
+                    returnPair.setInteger(clusterCount);
+                    //returnArray.add(clustersFoundRGB);
+                }
+                else{
+                    returnPair.setBoolean(false);
+                    returnPair.setInteger(clusterCount);
+                    //returnArray.add(clustersFoundRGB);
+                }
+            }
+        }
+        catch (Exception e) {
+            System.err.println(e.getMessage());
+        }
+        return returnPair;
+    }
+
+    //******************
+    //INTERNAL FUNCTIONS
+    //******************
+
+    public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list) {
+        //DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED
+        // Function to remove duplicates from an ArrayList
+        // Create a new ArrayList
+        ArrayList<T> newList = new ArrayList<T>();
+        // Traverse through the first list
+        for (T element : list) {
+            // If this element is not present in newList
+            // then add it
+            if (!newList.contains(element)) {
+                newList.add(element);
+            }
+        }
+        // return the new list
+        return newList;
+        //DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED//DIRECTLY COPIED
+    }
+    public static double VarianceCalc(StartAndEndPoint parseArray[]){
+        double sum =0;
+        double temp =0;
+        double mean, variance;
+        int size = parseArray.length;
+        //Calculate sum of array
+        for(int i =0; i < parseArray.length; i++){
+            sum += parseArray[i].getP1().y;
+        }
+        //Calculate mean of array
+        mean = sum/parseArray.length;
+        //Calculate variants
+        for(int i =0; i < size; i++){
+            temp += Math.pow((parseArray[i].getP1().y-mean),2);
+        }
+        variance = Math.abs(temp/(size -1));
+        //System.out.println("VARIANCE: " + variance);
+        return variance;
+    }
+    public static Boolean lineComparison(double baseLineS, double compareLineS, double compareLineE ){
+        //System.out.print("Comparing baseLineS: " + baseLineS + " with compareLineE: " + compareLineE + " and compareLineS: " + compareLineS);
+        if(baseLineS < compareLineE && baseLineS > compareLineS){
+            return true;
+        }
+        return false;
+    }
+    public static Boolean ClusterCheck(StartAndEndPoint parseArray[]){
+        try {
+            //System.out.println("LENGTH: " + parseArray.length);
+            //MAKE THREE COMPARISONS
+            //After clusters have been found.
+            //Check if  their x positions intersect
+            //Logic being
+            //(L1.S < L2.E && L1.S > L2.S)
+            //or
+            //(L2.S < L1.E && L2.S > L1.S)
+            //Variance is using Start of line point.
+            //USING VARIANTS
+            double variance = VarianceCalc(parseArray);
+            Boolean consistent = false;
+            if (variance <= CLUSTER_DISTANCE_MAX && variance > CLUSTER_DISTANCE_MIN) {
+
+                for (int i = 0; i < parseArray.length - 1; i++) {
+                    //System.out.println(i);
+                    double l1_S = parseArray[i].getP1().x;
+                    double l1_E = parseArray[i].getP2().x;
+                    double l2_S = parseArray[i + 1].getP1().x;
+                    double l2_E = parseArray[i + 1].getP2().x;
+
+                    //Check which starts after
+                    if (l1_S >= l2_S) {
+                        //baseLineStart is l1_S (call with lineComparison)
+                        consistent = lineComparison(l1_S, l2_S, l2_E);
+                    } else if (l2_S > l1_S) {
+                        //baseLineStart is l2_S (call with lineComparison)
+                        consistent = lineComparison(l2_S, l1_S, l1_E);
+                    } else {
+                        System.err.println("An error, comparing l1_S and l2_S, has occurred");
+                    }
+
+                    //Check if false was returned;
+                    if (consistent == false) {
+                        /*System.out.print(" X positions of two lines did not overlap each other:" + '\t');
+                        System.out.print("l1_S: " + l1_S + '\t');
+                        System.out.print("l1_E: " + l1_E + '\t');
+                        System.out.print("l2_S: " + l2_S + '\t');
+                        System.out.print("l2_E: " + l2_E);
+                        System.out.println(" ");*/
+                        return false;
+                    }
+                }
+                //Have been through for loop, maintaining consistent being true.
+                //Have also meet the variance MIN and MAX requirement. Therefore it is a cluster
+                return true;
+            }
+            //System.out.println("Did not meet Cluster Distance Min and Max requirements, Variance = " + variance);
+            return false;
+        }
+        catch (Exception e){
+            System.err.println("           "+e.getMessage());
+            return false;
+        }
+    }
+}
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 33414)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/javaImageClassifier.java	(revision 33415)
@@ -263,5 +263,5 @@
  //******************
 
-    private static  BufferedImage toBufferedImage(Mat mat){
+    private static BufferedImage toBufferedImage(Mat mat){
         //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         //MOSTLY COPY PASTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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 33414)
+++ /other-projects/is-sheet-music-encore/trunk/image-identification-terminal/runClassifer.sh	(revision 33415)
@@ -2,5 +2,5 @@
 
 if [ $# != 4 ] ; then 
-  echo "Usage: ./testClassifier.sh folder/file_name classifier_type output_filename type(-a:all -test:100 -single:1)" 1>&2
+  echo "Usage: ./testClassifier.sh folder/file_name classifier_type output_filename  type(-a:all -test:100 -single:1)" 1>&2
   exit 1
 fi
@@ -22,5 +22,16 @@
 			i=$[$i+1]
 		done
-	;;
+		;;
+	
+	-allNew)
+	    for file_name in $folder_name/*/*.png; do
+		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/  javaClassifierComparison $file_name $classifier_type $output
+		i=$[$i+1]
+	    done
+	    ;;
 		
 	-test)
@@ -50,9 +61,17 @@
 		#Runs javaImagesClassifier on ONE image
 		javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaImageClassifier.java;
+		echo $folder_name
+		echo $output
+		echo $classifier_type
+		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 $folder_name $classifier_type $output
+	;;
+	
+	-singleNew)
+		#Runs javaImagesClassifier on ONE image
+		javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar -Xlint javaClassifierComparison.java;
 		echo $file_name
 		echo $output
 		echo $classifier_type
-		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
-
+		java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/  javaClassifierComparison $folder_name $classifier_type $output
 			
 esac		
