class GermanLutePage

Last modified: May 13, 2016

Contents

GermanLutePage

In module gamera.toolkits.otr.german_page

Performs layout analysis on a german page. The layout analysis assumes that lines of tablature are separated by horizontal lines.

The complete layout analysis is done in the constructor. The results are stored in the following properties:

line_height, character_height, distance_between_two_lines
characteristic page dimensions
line_groups
Array of detected lines. Each line is itself a list of all vertical runs belonging to the line.
straight_lines
List of the parameters (m,b) for all least square fitted lines.

For interactive testing, a GermanLutePage object can also be created from the context menu of the OTR toolkit icon in the Gamera GUI. This will create an icon representing the GermanLutePage object, and from its context menu you can display images showing the found separator lines or bars.

__init__

The constructor already does all the layout analysis. Consequently there is usually no need to call any other methods of GermanLutePage.

Signature:

__init__(image, bar_detection=True, clean=False, log_file=None, debug=0)

with

image:
Onebit or greyscale image to be processed.
bar_detection:
Whether bars are to be detected heuristically.
clean:
Whether gaps in fragmented separator lines shall be searched for additional line fragments.
log_file:
File name of a log file for debugging. When None, no logfile is written.
debug:
Debug level (i.e. verbosity level). Can be 0,1 or 2.

mark_bars

Returns an RGB image with all heuristically found barlines highlighted in red. Note that this only makes sense when you have initially chosen the heuristic bar detection in the constructor.

mark_lines

Returns an RGB image with all found separator lines highlighted in red.