This project focuses on recognizing musical notes from given test images using Template Matching and other image processing techniques. The goal is to identify the notes and play the corresponding music.
An interesting point of this project is that the project is implemented in python and also matlab. The matlab implementation lies in the ..\Main
directory, while all other files and directories are python implementation of the project.
In this project, we:
- Identified musical notes using Template Matching.
- Drawed rectangles around the identified notes in the images.
- Generated audio outputs for each page of music.
- Python
- OpenCV
- Jupyter Notebook
or you can use the matlab file in
..\Main
diretory.
Firslty, we implemented Template Matching. Then, we identified notes for the songs: Twinkle, Twinkle, Little Star
, Ava Maria
, Polyushka Polie
, and jane-maryam
and provide the corresponding outputs.
You can see the note' files in the images file: ..\images
.
Afterwards we identified black, white, and whole notes besides sharp and flat signs and confined them with red reactangles.
You can use the functions provided in ..\Helper\helper.ipynb
to assist with note recognition and drawing rectangles around identified notes.
- Use the position of the notes relative to the staff lines for recognition.
- If you encounter difficulties in detecting the staff lines, you can use the
cv2.HoughLinesP
function to find their coordinates.
At last for each song, we have submitted:
- Images with rectangles drawn around the identified notes.
- Audio outputs for each page of music.
Furthermore, You can see the output voices in .wav
format in this folder: ..\Results
- Python 3.x
- OpenCV
- Jupyter Notebook
- Clone the repository:
git clone https://github.com/MohammadParsaTheFirst/Music-Composer.git
- Navigate to the project directory:
cd Music-Composer
- Install the required packages:
pip install -r requirements.txt
- Open the Jupyter Notebook and run the cells in
helper.ipynb
to perform note recognition and generate outputs.
This project is licensed under the MIT License - see the LICENSE file for details.