text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientation (Operator)

Name

text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientation — 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)

Beschreibung

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

Der Parameter RegionRegionRegionRegionregion 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.

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

Durch OrientationFromOrientationFromOrientationFromOrientationFromorientationFrom und OrientationToOrientationToOrientationToOrientationToorientationTo kann der Suchbereich eingeschränkt werden, womit auch die Laufzeit von text_line_orientationtext_line_orientationTextLineOrientationTextLineOrientationTextLineOrientation beinflusst wird.

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

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHobject

Bildbereich der Textzeilen.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte / uint2)

Eingabebild.

CharHeightCharHeightCharHeightCharHeightcharHeight (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe der Textzeilen.

Defaultwert: 25

Typischer Wertebereich: 1 ≤ CharHeight CharHeight CharHeight CharHeight charHeight

Restriktion: CharHeight >= 1

OrientationFromOrientationFromOrientationFromOrientationFromorientationFrom (input_control)  angle.rad HTupleHTupleHtuple (real) (double) (double) (double)

Minimale Rotation der Textzeilen.

Defaultwert: -0.523599

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

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

OrientationToOrientationToOrientationToOrientationToorientationTo (input_control)  angle.rad HTupleHTupleHtuple (real) (double) (double) (double)

Maximale Rotation der Textzeilen.

Defaultwert: 0.523599

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

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

OrientationAngleOrientationAngleOrientationAngleOrientationAngleorientationAngle (output_control)  angle.rad(-array) HTupleHTupleHtuple (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_orientationTextLineOrientationTextLineOrientationTextLineOrientation den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

rotate_imagerotate_imageRotateImageRotateImageRotateImage, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImage, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSizeAffineTransImageSize

Modul

Foundation