## 4 Methodology
### Workflow  
The typical OMR pipeline usually breaks down in the following four stages as shown in [30]:  
1. image pre-processing,
2. staff line detection and recognition of musical symbols,
3. reconstruction of the musical information, and
4. construction of a musical notation model.  
Since the focus of this paper is to output an encoding of staves consisting of staff lines and music symbols that fully captures the written neume notation of the original manuscripts, only the first three steps are included in the proposed workflow. The omitted reconstruction of the output into a modern notation is, however, straightforward (compare Figure 1). Therefore, our pipeline starts with a scanned color image and ends with the reconstructed symbols that are recognised and positioned in a detected staff as seen in Figure 3.  
During the pre-processing, first, the raw image was deskewed and converted into grayscale by using OCRopus ([[https://github.com/tmbdev/ocropy/blob/master/ocropus-nlbin](https://github.com/tmbdev/ocropy/blob/master/ocropus-nlbin)]([https://github.com/tmbdev/ocropy/blob/master/ocropus-nlbin](https://github.com/tmbdev/ocropy/blob/master/ocropus-nlbin))). The deskewing algorithm was initially designed for processing textual documents in an OCR-pipeline, however it generalises flawlessly on our musical data. The algorithm first applied an array of small rotations on the image. Afterwards, for each rotated image all rows were averaged pixel-wise and the variance across the resulting vector was computed, which yielded a score for each initial rotation angle. Finally, finding the maximum yielded the best rotation angle.  
Next, our staff line detection algorithm was applied to the pre-processed image. The resulting staff lines were represented as polylines and grouped into single staves. Each staff was then cut out of the pre-processed image and the symbol detection was applied, which yielded a list of symbols including their absolute pixel position. Finally, this pixel position was converted to a location relative to the recognised staff lines to produce the final output. The last step for an actual transcription was a straightforward mapping which decoded these positions based on the detected clefs to actual note names, that is, the pitch. This step can induce subsequent faults if the clef was misclassified. The melody of a line however, which is defined by the intervals that are relative to the NCs, is independent of the clef which only defines the global pitch.  
Both the staff line and symbol detection make use of FCNs, which we will introduce in the following. Afterwards, the individual algorithms are described in greater detail.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Part** & **Pages** & **Staves** & **S.-Lines** & **Symbols** & **Notes** & **Clefs** & **Accid.** \\ \hline
1 & 14 & 125 & 500 & 3911 & 3733 & 153 & 25 \\
2 & 27 & 313 & 1252 & 10,794 & 10,394 & 361 & 39 \\
3 & 8 & 72 & 288 & 1666 & 1581 & 84 & 1 \\ \hline Total & 49 & 510 & 2040 & 16,371 & 15,708 & 598 & 65 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Overview of the data set statistics. The data set is split manually into three groups that share similarities in layout or handwriting.