This method extracts text that differ locally from the
background. Therefore, it is suited for images with
inhomogeneous illumination. The enhancement of the text
borders, leads to a more accurate determination of the
outline of the text. Which is especially useful if the
background is highly textured. The parameter
ContrastContrastContrastContrastcontrastcontrast defines the minimum contrast,i.e.,
the minimum gray value difference between symbols and
background.
CharWidthCharWidthCharWidthCharWidthcharWidthchar_width:
This can be a tuple with up to three values. The first value is the
average width of a character. The second is the minimum width of a
character and the third is the maximum width of a character.
If the minimum is not set or equal -1, the operator automatically sets
these value depending on the average CharWidthCharWidthCharWidthCharWidthcharWidthchar_width. The same is
the case if the maximum is not set. Some examples:
[10] sets the average character width to 10, the minimum and
maximum are calculated by the operator.
[10,-1,20] sets the average character width to 10, the minimum value is
calculated by the system, and the maximum is set to 20.
[10,5,20] sets the average character width to 10, the minimum to 5,
and the maximum to 20.
CharHeightCharHeightCharHeightCharHeightcharHeightchar_height:
This can be a tuple with up to three values. The first value is the
average height of a character. The second is the minimum height of a
character and the third is the maximum height of a character.
If the minimum is not set or equal -1, the operator automatically sets
these value depending on the average CharHeightCharHeightCharHeightCharHeightcharHeightchar_height. The same is
the case if the maximum is not set. Some examples:
[10] sets the average character height to 10, the minimum and
maximum are calculated by the operator.
[10,-1,20] sets the average character height to 10, the minimum value is
calculated by the system, and the maximum is set to 20.
[10,5,20] this sets the average character height to 10, the minimum to 5,
and the maximum to 20.
ContrastContrastContrastContrastcontrastcontrast:
Defines the minimum contrast between the text and the background. This
parameter is used if the segmentation method 'local_contrast_best'"local_contrast_best""local_contrast_best""local_contrast_best""local_contrast_best""local_contrast_best"
is selected.
List of values: 'local_auto_shape'"local_auto_shape""local_auto_shape""local_auto_shape""local_auto_shape""local_auto_shape", 'local_contrast_best'"local_contrast_best""local_contrast_best""local_contrast_best""local_contrast_best""local_contrast_best"
List of values: 'bold'"bold""bold""bold""bold""bold", 'light'"light""light""light""light""light", 'medium'"medium""medium""medium""medium""medium", 'ultra_light'"ultra_light""ultra_light""ultra_light""ultra_light""ultra_light"
for Index := 1 to 5 by 1
read_image (Image, 'dot_print_rotated/dot_print_rotated_'+Index$'02d')
text_line_orientation (Image, Image, 50, rad(-30), rad(30), OrientationAngle)
rotate_image (Image, ImageRotate, deg(-OrientationAngle), 'constant')
segment_characters (ImageRotate, ImageRotate, ImageForeground, \
RegionForeground, 'local_auto_shape', 'false', 'false', 'medium', \
25, 25, 0, 10, UsedThreshold)
endfor
Result
If the input parameters are set correctly, the operator
segment_characterssegment_charactersSegmentCharactersSegmentCharactersSegmentCharacterssegment_characters returns the value 2 (H_MSG_TRUE). Otherwise an
exception will be raised.