text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationtext_line_orientation (Operator)

Name

text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationtext_line_orientation — Bestimmen der Orientierung einer Textzeile oder eines Textabschnittes.

Signatur

text_line_orientation(Region, Image : : CharHeight, OrientationFrom, OrientationTo : OrientationAngle)

Herror text_line_orientation(const Hobject Region, const Hobject Image, const Hlong CharHeight, double OrientationFrom, double OrientationTo, double* OrientationAngle)

Herror T_text_line_orientation(const Hobject Region, const Hobject Image, const Htuple CharHeight, const Htuple OrientationFrom, const Htuple OrientationTo, Htuple* OrientationAngle)

void TextLineOrientation(const HObject& Region, const HObject& Image, const HTuple& CharHeight, const HTuple& OrientationFrom, const HTuple& OrientationTo, HTuple* OrientationAngle)

HTuple HRegion::TextLineOrientation(const HImage& Image, Hlong CharHeight, double OrientationFrom, double OrientationTo) const

static void HOperatorSet.TextLineOrientation(HObject region, HObject image, HTuple charHeight, HTuple orientationFrom, HTuple orientationTo, out HTuple orientationAngle)

HTuple HRegion.TextLineOrientation(HImage image, int charHeight, double orientationFrom, double orientationTo)

def text_line_orientation(region: HObject, image: HObject, char_height: int, orientation_from: float, orientation_to: float) -> Sequence[float]

def text_line_orientation_s(region: HObject, image: HObject, char_height: int, orientation_from: float, orientation_to: float) -> float

Beschreibung

text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationTextLineOrientationtext_line_orientation bestimmt die Orientierung einer Textzeile oder eines Textabschnitts in Bezug auf die Bildhorizontale.

Der Parameter RegionRegionRegionRegionregionregion gibt an, in welchem Bereich des Bildes die Textzeilen liegen. Er dient lediglich zum Einschränken des Verarbeitungsbereichs. Innerhalb dieser Region werden die Grauwerte zur Bestimmung der Orientierung verwendet. Die Textzeilen werden vom Operator selbst segmentiert. Wird mehr als eine Region übergeben, dann werden die Zahlenwerte des Orientierungswinkels in einem Tupel abgespeichert, wobei die Position eines Wertes in dem Tupel der Position der Region im Eingabetupel entspricht.

CharHeightCharHeightCharHeightCharHeightcharHeightchar_height gibt die ungefähre Höhe der Textzeilen im Bereich RegionRegionRegionRegionregionregion an. Hierbei wird angenommen, dass die Textzeilen dunkler sind als der Hintergrund.

Durch OrientationFromOrientationFromOrientationFromOrientationFromorientationFromorientation_from und OrientationToOrientationToOrientationToOrientationToorientationToorientation_to kann der Suchbereich eingeschränkt werden, womit auch die Laufzeit von text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationTextLineOrientationtext_line_orientation beinflusst wird.

Mit Hilfe des berechneten Winkels OrientationAngleOrientationAngleOrientationAngleOrientationAngleorientationAngleorientation_angle und Operatoren wie affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image kann der Bereich RegionRegionRegionRegionregionregion des Bildes ImageImageImageImageimageimage so gedreht werden, dass die Textzeilen wieder horizontal im Bild erscheinen. Dies vereinfacht möglicherweise die Zeichensegmentierung für OCR-Anwendungen.

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregionregion (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Bildbereich der Textzeilen.

ImageImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2)

Eingabebild.

CharHeightCharHeightCharHeightCharHeightcharHeightchar_height (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe der Textzeilen.

Defaultwert: 25

Typischer Wertebereich: 1 ≤ CharHeight CharHeight CharHeight CharHeight charHeight char_height

Restriktion: CharHeight >= 1

OrientationFromOrientationFromOrientationFromOrientationFromorientationFromorientation_from (input_control)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Minimale Rotation der Textzeilen.

Defaultwert: -0.523599

Typischer Wertebereich: -3.141593 ≤ OrientationFrom OrientationFrom OrientationFrom OrientationFrom orientationFrom orientation_from ≤ 3.141593

Restriktion: -2 * pi <= OrientationFrom <= 2 * pi

OrientationToOrientationToOrientationToOrientationToorientationToorientation_to (input_control)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Maximale Rotation der Textzeilen.

Defaultwert: 0.523599

Typischer Wertebereich: -3.141593 ≤ OrientationTo OrientationTo OrientationTo OrientationTo orientationTo orientation_to ≤ 3.141593

Restriktion: OrientationFrom <= OrientationTo && OrientationTo < OrientationFrom + pi

OrientationAngleOrientationAngleOrientationAngleOrientationAngleorientationAngleorientation_angle (output_control)  angle.rad(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Berechnete Rotationswinkel der Textzeilen.

Beispiel (HDevelop)

read_image(Image,'letters')
text_line_orientation(Image,Image,50,rad(-80),rad(80),OrientationAngle)
rotate_image(Image,ImageRotate,-OrientationAngle/rad(180)*180,'constant')

Ergebnis

Sind die Eingabeparameter korrekt besetzt, dann liefert text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationTextLineOrientationtext_line_orientation den Wert TRUE. Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSizeAffineTransImageSizeaffine_trans_image_size

Modul

Foundation