Halcon-图形旋转,放大的仿射变换

以下为范例代码:

dev_close_window ()
dev_open_window (0, 0, 512, 512, 'white', WindowID)
dev_set_color ('black')
* Draw with the mouse an arbitrary region into the window
draw_region (Region, WindowID)
hom_mat2d_identity (HomMat2DIdentity)
*求一个单位矩阵
hom_mat2d_rotate (HomMat2DIdentity, 0.3, 256, 256, HomMat2DRotate)
*求一个旋转矩阵,绕点256,256旋转-0.3度(逆时针)
hom_mat2d_scale (HomMat2DRotate, 1.5, 1.5, 256, 256, HomMat2DScale)
*求一个缩放矩阵,以点256,256为基点,扩大X轴1.5,Y轴扩大1.5倍
affine_trans_region (Region, RegionAffineTrans, HomMat2DScale, 'nearest_neighbor')
*将得出的矩阵作用于画出的图
dev_clear_window ()
dev_set_draw ('margin')
dev_set_color ('red')
dev_display (Region)
dev_set_color ('green')
dev_display (RegionAffineTrans)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值