Skip to content

Conversation

@DeannaLC
Copy link
Member

@DeannaLC DeannaLC commented Mar 26, 2025

Resolves: (#1254)

  • I passed the docker hub test, and images can be built successfully.
  • I passed the GitHub CI test, so rodan functionalities and jobs work.

This branch adds a new job called Aquitanian Reference Line Finding. In a full OMR workflow, this job would replace Miyao Staff Finding which does not have a case for dealing with one line per staff.

There is one input port for an image of the classified lines, an output port for the JSOMR file, and an optional PNG output port to see the lines overlaid on the image. There's a setting slices to change the number of sections per reference line with the default being 8.

The job uses cv2.findContours to first get each separate reference line and draws rectangles around them with cv2.boundingRect. Then, each rectangle is split into the amount of slices, with a bounding box being drawn around each line segment. A line is drawn through the center of the bounding box, and each of the line segments are connected together.

For now this is a separate job since it has its own slices parameter, but this could also be moved into Miyao Staff Finding as an if case for Number of Lines = 1.

@martha-thomae @fujinaga

Screenshot 2025-03-25 172637

@martha-thomae
Copy link

Hi @DeannaLC, could you revert the last commit and make a separate pull request for the fixing of the MEI Encoding job?

It is better to keep separate pull requests for different issues that you are solving. So, it would be better to create another branch on your fork for the MEI Encoding job fix, make the commit there, and then a pull request with that change (and link it to the issue, see here). Thank you!

@homework36 homework36 self-requested a review March 31, 2025 21:23
@homework36
Copy link
Contributor

homework36 commented Mar 31, 2025

  1. Can you provide files for different test cases? We need that to test locally and make sure it functions properly.
  2. It'll be great if you can include test_my_task in AquitanianReferenceLineFinding. You can refer to other jobs like rodan-main/code/rodan/jobs/MEI_resizing/mei_resize.py.

Thanks. @DeannaLC

@DeannaLC
Copy link
Member Author

DeannaLC commented Apr 1, 2025

@homework36

I've been doing some testing with running this job as an input into Heuristic Pitch Finding which hasn't yet been successful, so for the time being I'm going to switch this pull request to a draft.

@DeannaLC DeannaLC self-assigned this Apr 1, 2025
@DeannaLC DeannaLC marked this pull request as draft April 1, 2025 21:24
@DeannaLC DeannaLC marked this pull request as ready for review April 28, 2025 20:05
@DeannaLC
Copy link
Member Author

DeannaLC commented May 7, 2025

@homework36 I've confirmed this project works in the full end to end workflow, so I've reopened the pull request.

For the test files, I'm using classified glyphs and lines from 044v in the Salamanca Missal. I ran my job with the settings slices = 8 and Neume Height multiplied by 3 = 30. My job replaces Miyao Staff Finding in the End to End workflow, and it gives an output with the coordinates for the reference line, plus 4 more lines with 2 lines above and 2 lines below based on the neume height parameter above.

Since Neon doesn't work correctly with one staff line, I'm setting 'staffDef.lines=5' so it properly displays. There's currently an issue with neumes being above the staff line in Neon which I'm not sure whether should be fixed through my job or Heuristic Pitch Finding, but after aligning the glyphs to the image, it seems to have pretty accurate results.

Job Workflow (PNG input is classified reference lines):
Screenshot 2025-05-07 172543

044v Reference Line input:
044v Ref Lines

044v Interactive Classifier input for Heuristic Pitch Finding:
044v Interactive Classifier.zip

Overlayed Reference Line output (red is the lines drawn on by the Aquitanian Staff Finding job):
044v Overlayed Lines

Aquitanian Staff Finding JSON output (same as Miyao):
044v Aquitanian Staff Finding.json

Heuristic Pitch Finding output:
044v Heuristic.json

MEI Encoding output(would ideally have 1 line, but set to 5 for Neon compatibility):
044v MEI.zip

Glyphs in Neon after adjusting:
Screenshot 2025-05-07 165042

@homework36
Copy link
Contributor

This looks good, but one test file/case is not enough for us to make sure it works properly. Can you provide a second folio with a different layout/configuration, at least? Thanks.

Copy link
Contributor

@homework36 homework36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you should note in your codes what each function is doing, at least.

@DeannaLC
Copy link
Member Author

Here's a couple other cases with different layouts. One of them has one column, and the other just has a few staves at the bottom of the page. The files I'm providing are for full end to end workflows without the interactive classifier part, which I've provided files for.

Another note is that to get the files to display properly in Neon, I have to change the MEI file where staffDef.lines = 5 and staffDef.clef.line = 2. I spoke with Martha, and we didn't want to include it as part of this pull request because it's not necessarily accurate due to this having just 1 line, so for the time being it's a manual change.

Workflow for 034r (No column splitting since it only has one column)
Screenshot 2025-06-18 150630

Workflow for 019v
Screenshot 2025-06-18 151009

034r Results in Neon:
image

019v Results in Neon:
image

Test Cases:
019v Test Files.zip
034r Test Files.zip

@martha-thomae martha-thomae requested a review from homework36 July 9, 2025 15:08
@homework36
Copy link
Contributor

homework36 commented Jul 10, 2025

Thank you! I tested locally. This looks good now.
But the 034r workflow does not seem to have the Aquitanian Staff Finding job?

@DeannaLC
Copy link
Member Author

Sorry, took the screenshot before I swapped out Miyao for Aquitanian! The actual workflow looks like this:
image

Is this good to merge otherwise?

@homework36
Copy link
Contributor

@DeannaLC This looks good to me, and I think this PR can be merged.

@DeannaLC DeannaLC merged commit 50df7c8 into develop Jul 14, 2025
2 checks passed
@github-actions github-actions bot mentioned this pull request Jul 16, 2025
2 tasks
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

Successfully merging this pull request may close these issues.

4 participants