read_image(Image, 'C:/Users/22710/Pictures/halcon.png')
get_image_size(Image, Width, Height)
dev_close_window()
dev_open_window(0, 0, Width*2, Height*2, 'black', WindowHandle)
dev_display(Image)
draw_region(Region, WindowHandle)
*二维矩阵
hom_mat2d_identity(HomMat2DIdentity)
*平移,相对坐标
hom_mat2d_translate(HomMat2DIdentity, 64, 64, HomMat2DTranslate)
*移动
affine_trans_region(Region, RegionAffineTrans, HomMat2DTranslate, 'nearest_neighbor')
*矩阵旋转
dev_display(Image)
dev_display(Region)
hom_mat2d_identity(HomMat2DIdentity1)
area_center(Region, Area, Row, Column)
*旋转
hom_mat2d_rotate(HomMat2DIdentity1, 0.78, Row, Column,HomMat2DRotate)
*扩展图像转换
affine_trans_region(Region, RegionAffineTrans1, HomMat2DRotate, 'nearest_neighbor')
dev_display(Image)
dev_display(Region)
*刚性放射变换,对图像和区域进行放射变换
vector_angle_to_rigid(Row, Column, 0, Row+20, Column+20, rad(45), HomMat2D)
affine_trans_region(Region, RegionAffineTrans2, HomMat2D, 'nearest_neighbor')
*图片旋转
affine_trans_image(Image, ImageAffineTrans, HomMat2D, 'constant', 'false')