*读取文字图片
read_image(Image,‘letters‘) *先旋转一个角度
rotate_image(Image, ImageRotate1, -15, ‘constant‘) *获取字体的旋转角度
text_line_orientation(ImageRotate1,ImageRotate1,50,rad(-90),rad(90),OrientationAngle) *根据字体角度旋转回正常的角度
rotate_image(ImageRotate1,ImageRotate,(1.57-OrientationAngle)/3.14159*180,‘constant‘)
====================================================
text_line_orientation(Region, Image : : CharHeight, OrientationFrom, OrientationTo : OrientationAngle)
目的:确定文本行或段落的方向。
参数一(input_object):文本行区域。可以自己画一个矩形区域,也可以直接输入整个图片为文本行区域
参数二(input_object):输入图像
参数三(input_object):文本行的高度
参数四(input_object):文本行的最小旋转角度
参数五(input_object):文本行最大旋转角度
参数六(output_control) :得到的计算的文本行旋转角度。也是我们做需要的,之后对图形文字进行旋转或仿射变换时需要用到该参数
原文:https://www.cnblogs.com/gspuser/p/13461767.html