aboutsummaryrefslogtreecommitdiffstats
path: root/note_detection.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'note_detection.hpp')
-rw-r--r--note_detection.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/note_detection.hpp b/note_detection.hpp
new file mode 100644
index 0000000..0b745b4
--- /dev/null
+++ b/note_detection.hpp
@@ -0,0 +1,28 @@
+#include <opencv2/core/core.hpp>
+
+// constant definitions
+#define HEIGHT 220
+#define NOTEHEIGHT 90
+#define START 393 // FIRST LINE: 393; SECOND LINE: 685
+#define THRESHOLD 10
+#define LINEAPPROXIMATION 3
+#define STAVENUM 6
+#define TOPLIMIT 25
+#define BOTLIMIT 14
+#define NOTEBIT 5
+#define NOTEDIFF 120
+
+// all the functions used
+void drawRowInt(cv::Mat&, int*);
+void findHorizLines(cv::Mat&, int*);
+void drawColInt(cv::Mat&, int*);
+void findVertLines(cv::Mat&, int*);
+void findPeaks(int*, int, int*, int&);
+void findNotes(int*, int&, int*, int&);
+void drawNoteLoc(cv::Mat&, int*, int&);
+void extractNotes(int*, int&, int*, int&);
+bool inside(int*, int, int);
+void findPitch(cv::Mat&, int*, int*, int&, int*, int*);
+void getNotePitch(int*, int*, int*, int&);
+void findRests(int*, int*, int*, int(*)[2], int&, int&);
+void getKey(int, char, bool*);