BreezeWhite / oemer

End-to-end Optical Music Recognition (OMR) system. Transcribe phone-taken music sheet image into MusicXML, which can be edited and converted to MIDI.
https://breezewhite.github.io/oemer/
MIT License
394 stars 46 forks source link

error always occurs when extracting stafflines #4

Closed songkq closed 2 years ago

songkq commented 2 years ago

2022-04-18 13:06:51 Dewarping 2022-04-18 13:07:00 Extracting stafflines /usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py:3441: RuntimeWarning: Mean of empty slice. out=out, **kwargs) /usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) 91 321 3 322 552 3 553 783 3 784 1014 3 1015 1245 1246 1476 1 1477 1707 1708 1940 Traceback (most recent call last): File "/usr/local/bin/oemer", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/oemer/ete.py", line 261, in main mxl_path = extract(args) File "/usr/local/lib/python3.7/dist-packages/oemer/ete.py", line 157, in extract staffs, zones = staff_extract() File "/usr/local/lib/python3.7/dist-packages/oemer/staffline_extraction.py", line 366, in extract f"Unit sizes not consistent (th: {unit_size_diff_th}): {norm(unit_size)}") oemer.exceptions.StafflineUnitSizeInconsistent: Unit sizes not consistent (th: 0.1): [0.05035999 0.0562467 0.05098227 0.01743093 0.17501989]

songkq commented 2 years ago

image

songkq commented 2 years ago

@BreezeWhite hi,could you please to give some kind advices for the above mentioned issues?

songkq commented 2 years ago

Here are some of my testcases cell_06 cell_03d cell_05

BreezeWhite commented 2 years ago

I've tried all your images, and the errors seem to relate to the qualities of your images. I suggest you re-photo your images in a better condition, with brighter environment, more clear quality, and no blurry to the symbols. Also please center your photo angle right above your score, making everything is both vertically and horizontally aligned, since the images you provided look pretty skewed.

songkq commented 2 years ago

I've tried all your images, and the errors seem to relate to the qualities of your images. I suggest you re-photo your images in a better condition, with brighter environment, more clear quality, and no blurry to the symbols. Also please center your photo angle right above your score, making everything is both vertically and horizontally aligned, since the images you provided look pretty skewed.

Thanks for your reply. I wonder if we can adjust some of the hyperparameters during the dewarping step to fit skewed or curve stafflines.

BreezeWhite commented 2 years ago

Sorry but I'm afraid I could not help too much since I'm too busy recently. But of course you could try to tune the parameters by yourself and see if the results become better.