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 windowdraw_region(Region,WindowID)
*在窗口中画出region区域,如图5-13中内轮廓闭合曲线ahom_mat2d identity (HomMat2DIdentity)
*定义仿射变换矩阵hom_mat2d rotate (HomMat2DIdentity,一0.3,256,256,HomMat2DRotate)*在2D齐次仿射变换中增加旋转变换,-0.3代表旋转角度,负值代表顺时针旋转;256256代表基准点,此点固定不变
hom mat2d scale (HomMat2DRotate,1.5,15,256,256,HomMat2DScale)
*在2D齐次仿射变换中增加缩放变换,1.515代表缩放倍数
hom_mat2d translate (HomMat2DScale,32,32,HomMat2DTranslate)
*在2D齐次仿射变换中增加平移变换,32、32为行列的平移量
affine_trans_region (Region, RegionAffineTrans,HomMat2DScale,"nearest neighbor')*针对region做仿射变换,Region为变换前的区域,RegionAffineTrans为变换后的区域HomMat2D为仿射变换矩阵,Interpolate为插值方法,插值方法在后面有详解
dev clear window ()
dev_set draw('margin )
affine_trans_region
最新推荐文章于 2024-03-13 13:58:55 发布