Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aquitanian Staff Finding Job #1242

Open
DeannaLC opened this issue Dec 26, 2024 · 5 comments
Open

Aquitanian Staff Finding Job #1242

DeannaLC opened this issue Dec 26, 2024 · 5 comments

Comments

@DeannaLC
Copy link

I am working on the first job toward Aquitanian Pitch Finding with @fujinaga and @martha-thomae to find a center line in Salamanca Missal. Since the line isn't visible enough to be found by the computer, I plan to work off the observation that the midpoint of the text lies in the center between two lyric lines.

I am first planning to use Pixel to create 2-3 layers to try out.

  1. One layer will contain the just the neumes
  2. The other layer(s) will have the lyrics and the red lines
    • This can either be 1 layer with both the lyrics and the red line, or one layer with the lyrics and one with the red line

Another observation about finding the center line was that the bottom of the larger text on the other side of the page from the neumes lines up with the center line, so if needed or if this works better, it could be classified as another layer.

I am planning to reference the Staff Distance job for reference, but would also be very happy to hear any other suggestions for jobs I can use for a starting point.

@martha-thomae
Copy link

martha-thomae commented Jan 10, 2025

I am planning to reference the Staff Distance job for reference, but would also be very happy to hear any other suggestions for jobs I can use for a starting point.

Maybe you could look at the Miyao Staff Finding job. @fujinaga, @annamorphism, @JoyfulGen, @kyrieb-ekat would this be the right job for Deanna to grab inspiration for what she is implementing? She wants to extrapolate a full straight line from segments of the red lines in the lyrics (see example image).

020v
Folio 020v, Salamanca missal

@martha-thomae
Copy link

@elsinhadl said:

  • It is safe to assume that the one staff line is in the midpoint o two text lines
  • However, although the red lines at the bottom of the text appear in many manuscripts, they don’t always appear throughout the whole text (e.g., they don't appear when the text is tightly close together). So we will need to eventually use the text as reference rather than the red lines.

We need to find the baseline of the text to use that as reference and then find the midpoint staff line with that.

@martha-thomae
Copy link

martha-thomae commented Jan 17, 2025

Next steps:

  • Include the job as it is in Rodan (make your own branch) to see if it works as expected. So far, Deanna has detected the red lines and expanded them and detected the line between these as the one staff line. The output of the job should be similar to the output of Miyao Staff Finding job, as this is the job preceding the Heuristic Pitch Finding

  • Then move to use the baseline of the text rather than the red lines

@DeannaLC
Copy link
Author

DeannaLC commented Feb 1, 2025

I'm working through a couple approaches in order to find the music reference line and will evaluate which one works better. I'm using cv2 for image processing on one layer I get with Pixel that has both lyrics and red lines. Since each folio has two columns of music and text, I also need to work on a good method of column separation.

Approach 1 - Strikethrough line

This uses HoughLines in order to detect lines, then draws a line through the lyrics and text. Many lines are produced so I filter out the lines to keep the straightest one through each line of text. I sort the lines by their y values then take pairs of them and draw a line in between.

Image

Approach 2 - Bounding Box/Underlining

I use cv2's bounding boxes that I take the bottom line of so it underlines the text rather than doing a strikethrough. There's a slight issue with letters such as y which go below the text and change the box. I'm working on figuring out how to expand the lines, then use that to get the midpoint.

(I put random colors based on whether sets of lines are grouped so the same image has different colors between the pictures)
Bounding Boxes around text:

Image

Underline by taking bounding box points:

Image

@annamorphism
Copy link

I like Approach 2 (since ultimately we want to get the line the letters are sitting on, not their midpoint.) I can see that letters like y (or p, or q) with significant descenders would be a problem, though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants