KlassenKlassenKlassenKlassen | | | | Operatoren

text_line_orientationtext_line_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation (Operator)

Name

text_line_orientationtext_line_orientationTextLineOrientationtext_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)

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

Herror text_line_orientation(Hobject Region, Hobject Image, const HTuple& CharHeight, const HTuple& OrientationFrom, const HTuple& OrientationTo, HTuple* OrientationAngle)

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

HTuple HRegionArray::TextLineOrientation(const HImage& Image, const HTuple& CharHeight, const HTuple& OrientationFrom, const HTuple& OrientationTo) const

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

void HOperatorSetX.TextLineOrientation(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* Image, [in] VARIANT CharHeight, [in] VARIANT OrientationFrom, [in] VARIANT OrientationTo, [out] VARIANT* OrientationAngle)

VARIANT HRegionX.TextLineOrientation(
[in] IHImageX* Image, [in] Hlong CharHeight, [in] double OrientationFrom, [in] double OrientationTo)

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_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation 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.

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

Durch OrientationFromOrientationFromOrientationFromOrientationFromOrientationFromorientationFrom und OrientationToOrientationToOrientationToOrientationToOrientationToorientationTo kann der Suchbereich eingeschränkt werden, womit auch die Laufzeit von text_line_orientationtext_line_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation beinflusst wird.

Mit Hilfe des berechneten Winkels OrientationAngleOrientationAngleOrientationAngleOrientationAngleOrientationAngleorientationAngle und Operatoren wie affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage 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.

Parallelisierung

Parameter

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Bildbereich der Textzeilen.

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2)

Eingabebild.

CharHeightCharHeightCharHeightCharHeightCharHeightcharHeight (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Höhe der Textzeilen.

Defaultwert: 25

Typischer Wertebereich: 1 ≤ CharHeight CharHeight CharHeight CharHeight CharHeight charHeight

Restriktion: CharHeight >= 1

OrientationFromOrientationFromOrientationFromOrientationFromOrientationFromorientationFrom (input_control)  angle.rad HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Minimale Rotation der Textzeilen.

Defaultwert: -0.523599

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

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

OrientationToOrientationToOrientationToOrientationToOrientationToorientationTo (input_control)  angle.rad HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximale Rotation der Textzeilen.

Defaultwert: 0.523599

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

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

OrientationAngleOrientationAngleOrientationAngleOrientationAngleOrientationAngleorientationAngle (output_control)  angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (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_orientationTextLineOrientationtext_line_orientationTextLineOrientationTextLineOrientation den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

rotate_imagerotate_imageRotateImagerotate_imageRotateImageRotateImage, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSize

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren