Gamera

From Arnout Engelen

Jump to: navigation, search

Gamera is a successor of AOMR, which was meant for music recognition. Gamera is a more broad recognition engine, under which a music recognition can be implemented as a 'toolkit'.

See also:

Contents

[edit] General Gamera stuff

[edit] Using the Interactive Classifier

In the interactive classifier, ctrl-click a glyph in the grid to have it highlighted in the image.

Double-click on a name on the left to specify all selected glyphs should be recognised as such.


[edit] Using Gamera for music recognition

There is a demo of how music recognition should work, and a research paper on the same.

Okay, so I downloaded Gamera from CVS and installed as per the instructions. so far so good.

  • Source image: used the Gimp to extract a TIFF page from a PDF songbook.
  • Opened it in Gamera, used 'Deformations/rotate' to put it straight (This could be automated using rotation_angle_projections)
  • Tresholding/djvu_treshold to treshold
  • Morphology/dilate to make the lines thicker
  • Classify->Interactive classifier to open a classifier

[edit] AOMR2: omr toolkit

AOMR2 (aka GAMUT) is the OMR toolkit for Gamera. Get it from CVS at http://dkc.jhu.edu/cgi-bin/cvsweb.cgi using cvsweb-scrape or use http://bzzt.net/~arnouten/aomr2.tar.gz

[edit] Music Segmenter

The toolkit adds the 'remove_stems' and 'music_segmentation' segmentation algorithms. The 'music_segmentation' algorithm seems to nicely segment all musical symbols properly ignoring the bar lines.

Seeing it in action in a couple of easy steps:

  • open Gamera
  • load the omr toolkit
  • Start the interactive classifier from the Classifier menu (right?)
  • image->'open and segment image'
  • choose the image and the music_segmentation algorithm

[edit] Classifying music

See: http://dkc.jhu.edu/gamera/html/training_tutorial.html

  • Load the names of symbols to be trained: File->Symbols->Import... music_symbol_table.xml
  • stems should be separated - anything with stems in it should be classified as '_split.remove_stems'
  • terminology: flags are the flags of e.g. single eights, beams connect e.g. multiple eights, ties connects single notes to make them longer.
  • if e.g. an accent is recognized as 2 glyphs, it should be classified as '_group.articulation.accent'

[edit] OMI

After removing the staves and recognising the glyphs, the next step is Optical music interpretation (2002 paper by Michael Droettboom, Ichiro Fujinaga, and Karl MacMillan).

AOMR2 includes a top-level script 'omr', which can be invoked from the command line in order to perform the entire recognition process. 'omr --help' will list the commandline arguments. aomr2 requires the celementtree python package.

It can be invoked like this, with .xml files for the classification data:

./scripts/omr --debug --music-db=niehaus_classifier.xml --text-db=text_db.xml jazzduet_dilated.png 

The '--debug' flag makes a 'OMI debugging' panel pop up after the analyses - if you make it there without crashing :). This allows you to evaluate the work done by the interpreter in more detail if you're interested in diving in ;).

[edit] MusicStaves toolkit

Seems to work fine (rl_simple or the one by Fujinaga), but not needed for the OMR toolkit. (The OMR toolkit includes the Fujinaga algorithm, but at some later date may include other staff removal algorithms.)

[edit] Problems

[edit] Crashes

The application tends to segfault when I resize the window (ubuntu linux).

The following error message:

/usr/lib/python2.4/site-packages/wx-2.4-gtk-ansi/wxPython/gdi.py:506: DeprecationWarning: integer argument expected, got float
  val = gdic.wxDC_Blit(self, *_args, **_kwargs)

... unfortunately doesn't seem to have to do with the segfaulting at all :).

I should figure out Debugging a segfaulting Python program, as I've had a Supybot segfaulting on me also and then I was also at a loss as to how to approach the bug.

[edit] History

Gamera came from Research on classifying symbols: Fujinaga (1996) in the Adaptive Optical Music Recognition (AOMR).

[edit] Links

Personal tools