OTR

Last modified: May 13, 2016

Contents

TabPage

object TabPage (int online = 0, str tab_type, int staffline_height = 0, int staffspace_height = 0)

Operates on:Image [OneBit|GreyScale]
Returns:object
Category:OTR
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz, Thomas Karsten

Creates a TabPage object.

preprocessing

deskew

Image [OneBit|GreyScale] deskew ()

Operates on:Image [OneBit|GreyScale]
Returns:Image [OneBit|GreyScale]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz

Detects a rotation angle and corrects it with the aid of skewed projections.

When the image is large, it is temporarily scaled down to a staffline height of two pixels for performance reasons.

otr_reset_onebit_image

otr_reset_onebit_image ()

Operates on:Image [OneBit]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz

Resets all black pixel values in a onebit image to one. This can be necessary e.g. after a CC analysis which sets black pixels to some other label value.

preprocess

Image [OneBit] preprocess (int speckle_size = 3, Choice [median|closing|wspeckle|none] smoothing_method, bool correct_rotation = False, bool remove_copy_border = False)

Operates on:Image [OneBit]
Returns:Image [OneBit]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christine Pranzas

This is only a wrapper function for the other preprocessing plugins. It provides a convenient GUI to select preprocessing operations and run them all at once.

remove_copy_border

Image [OneBit] remove_copy_border (ChoiceString(strict) [size|black_area] feature = size)

Operates on:Image [OneBit|GreyScale|RGB]
Returns:Image [OneBit]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz

Removes large CCs that are possibly black borders from scanning.

Depending on feature, large CCs are identified as follows:

size:
CCs with a height greater than the 20 times the median height or a width greater than 10 times the median width of all CCs with width/height > 3 (this median is an estimator for the oligon_width) are removed
black_area:
CCs with a black_area greater than 20 times the median black area are removed

remove_pictures

Image [OneBit] remove_pictures (int height_factor = 4)

Operates on:Image [OneBit]
Returns:Image [OneBit]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz

Removes large CC's that do not "look like" staff sections. This decision is based upon staffspace_height (most frequent white vertical run):

  • first the global staffspace height (ssh) is computed
  • then all CC's are removed which are larger than height_factor * ssh and whose most frequent white vertical run is different from ssh

smooth_onebit

Image [OneBit] smooth_onebit (int speckle_size = 3, Choice [median|closing|wspeckle] filter)

Operates on:Image [OneBit]
Returns:Image [OneBit]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz, Thomas Karsten

Smooth the image by first despeckling with speckle_size and then filtering out white speckles. The despeckling can be skipped by giving a zero speckle size. The filtering method depends on the option filter:

0: applies a median filter (rank(5))

1: closes the image with a 3x3 black structuring element.

2: like despeckle, but with white speckles

smoothen

Image [GreyScale|Grey16] smoothen ()

Operates on:Image [GreyScale|Grey16]
Returns:Image [GreyScale|Grey16]
Category:OTR/preprocessing
Defined in:otr_staff_plugins.py
Author:Christoph Dalitz

Convolves the image with a smoothing kernel, which is adapted to the characteristic image dimensions: it is n/2+1 pixels high and n pixels wide, where n is the staffline height of the image. This shape is chosen in such a way that stafflines become better connected.