一、刚体变换
vector_angle_to_rigid( : : Row1, Column1, Angle1, Row2, Column2, Angle2 : HomMat2D)
二、矩阵方式
1.单位矩阵
hom_mat2d_identity( : : : HomMat2DIdentity)
2.平移矩阵
hom_mat2d_translate( : : HomMat2D, Tx, Ty : HomMat2DTranslate)
3.旋转矩阵
hom_mat2d_rotate( : : HomMat2D, Phi, Px, Py : HomMat2DRotate)
4.缩放
hom_mat2d_scale (HomMat2DIdentity, 2, 2, Column1, Row1, HomMat2DScale)
三、变换使用算子
affine_trans_region(Region : RegionAffineTrans : HomMat2D, Interpolate : )
affine_trans_image(Image : ImageAffineTrans : HomMat2D, Interpolation, AdaptImageSize : )
四、投影变换
*原图需要转化区域点位
R1:=[130,60,225,290]
C1:=[102,271,95,289]
*转换后区域点位
R2:=[62.6481,62.6481,289.685,289.685]
C2:=[90.6901,290.999,90.6901,290.999]
*生成变换矩阵
hom_vector_to_proj_hom_mat2d (R1, C1, [1,1,1,1], R2, C2, [1,1,1,1], 'normalized_dlt', HomMat2D)
*投影变换
projective_trans_image (Image, TransImage, HomMat2D, 'bilinear', 'false', 'false')
变换前图像:
投影变换后图像:
五、错切
*text_line_orientation (Image, Image, 45, rad(-45), rad(45), OrientationAngle)用于文本整体倾斜
text_line_slant (Image, Image, 45, -0.523599, 0.523599, SlantAngle)用于字符倾斜
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_slant (HomMat2DIdentity, -SlantAngle, 'x', 0, 0, HomMat2DSlant)