admin 管理员组

文章数量: 887016

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)

本文标签: Halcon