KlassenKlassenKlassenKlassen | | | | Operatoren

text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant (Operator)

Name

text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant — Bestimmen der Neigung von Zeichen einer Textzeile oder eines Textabschnitts.

Signatur

text_line_slant(Region, Image : : CharHeight, SlantFrom, SlantTo : SlantAngle)

Herror text_line_slant(const Hobject Region, const Hobject Image, const Hlong CharHeight, double SlantFrom, double SlantTo, double* SlantAngle)

Herror T_text_line_slant(const Hobject Region, const Hobject Image, const Htuple CharHeight, const Htuple SlantFrom, const Htuple SlantTo, Htuple* SlantAngle)

Herror text_line_slant(Hobject Region, Hobject Image, const HTuple& CharHeight, const HTuple& SlantFrom, const HTuple& SlantTo, double* SlantAngle)

Herror text_line_slant(Hobject Region, Hobject Image, const HTuple& CharHeight, const HTuple& SlantFrom, const HTuple& SlantTo, HTuple* SlantAngle)

double HRegion::TextLineSlant(const HImage& Image, const HTuple& CharHeight, const HTuple& SlantFrom, const HTuple& SlantTo) const

HTuple HRegionArray::TextLineSlant(const HImage& Image, const HTuple& CharHeight, const HTuple& SlantFrom, const HTuple& SlantTo) const

void TextLineSlant(const HObject& Region, const HObject& Image, const HTuple& CharHeight, const HTuple& SlantFrom, const HTuple& SlantTo, HTuple* SlantAngle)

HTuple HRegion::TextLineSlant(const HImage& Image, Hlong CharHeight, double SlantFrom, double SlantTo) const

void HOperatorSetX.TextLineSlant(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* Image, [in] VARIANT CharHeight, [in] VARIANT SlantFrom, [in] VARIANT SlantTo, [out] VARIANT* SlantAngle)

VARIANT HRegionX.TextLineSlant(
[in] IHImageX* Image, [in] Hlong CharHeight, [in] double SlantFrom, [in] double SlantTo)

static void HOperatorSet.TextLineSlant(HObject region, HObject image, HTuple charHeight, HTuple slantFrom, HTuple slantTo, out HTuple slantAngle)

HTuple HRegion.TextLineSlant(HImage image, int charHeight, double slantFrom, double slantTo)

Beschreibung

text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant bestimmt die Neigung der Zeichen einer Textzeile oder eines Textabschnitts.

Der Parameter RegionRegionRegionRegionRegionregion gibt an, in welchem Bereich des Bildes die Textzeilen liegen. Sie dient lediglich zum Einschränken des Verarbeitungsbereichs. Innerhalb dieser Region werden die Grauwerte zur Bestimmung des Neigungswinkels verwendet. Die Textzeilen werden vom Operator selbst segmentiert. Wird mehr als eine Region übergeben, dann werden die Zahlenwerte des Neigungswinkels 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 SlantFromSlantFromSlantFromSlantFromSlantFromslantFrom und SlantToSlantToSlantToSlantToSlantToslantTo kann der Suchbereich eingeschränkt werden, womit auch die Laufzeit von text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant beinflusst wird.

Mit Hilfe des berechneten Winkels SlantAngleSlantAngleSlantAngleSlantAngleSlantAngleslantAngle und den Operatoren zur affinen Transformation kann die Neigung der Zeichen entfernt werden. Dies vereinfacht möglicherweise die Trennung von Zeichen für OCR-Anwendungen. Damit das Verfahren funktioniert, müssen alle Zeichen einer Region eine ähnliche Neigung besitzen.

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

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

Minimale Neigung der Zeichen

Defaultwert: -0.523599

Typischer Wertebereich: -0.785398 ≤ SlantFrom SlantFrom SlantFrom SlantFrom SlantFrom slantFrom ≤ 0.785398

Restriktion: - pi / 4 <= SlantFrom && SlantFrom <= SlantTo

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

Maximale Neigung der Zeichen

Defaultwert: 0.523599

Typischer Wertebereich: -0.785398 ≤ SlantTo SlantTo SlantTo SlantTo SlantTo slantTo ≤ 0.785398

Restriktion: - pi / 4 <= SlantTo && SlantTo <= pi / 4

SlantAngleSlantAngleSlantAngleSlantAngleSlantAngleslantAngle (output_control)  angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Berechnete Neigungswinkel der Zeichen in der Region

Beispiel (HDevelop)

hom_mat2d_identity(HomMat2DIdentity)
read_image(Image,'dot_print_slanted')
* correct slant
text_line_slant(Image,Image,50,rad(-45),rad(45),SlantAngle)
hom_mat2d_slant(HomMat2DIdentity,-SlantAngle,'x',0,0,HomMat2DSlant)
affine_trans_image(Image,Image,HomMat2DSlant,'constant','true')

Ergebnis

Sind die Eingabeparameter korrekt besetzt, dann liefert text_line_slanttext_line_slantTextLineSlanttext_line_slantTextLineSlantTextLineSlant den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

hom_mat2d_slanthom_mat2d_slantHomMat2dSlanthom_mat2d_slantHomMat2dSlantHomMat2dSlant, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSize

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren