dev_open_window(0, 0, 512, 512, 'black', WindowHandle)
dev_set_draw('margin')
draw_region(Region, WindowHandle)
smallest_rectangle2(Region, Row, Column, Phi, Length1, Length2)
gen_rectangle2(Rectangle, Row, Column, Phi, Length1, Length2)
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_rotate (HomMat2DIdentity, -0.2, -100, -100, HomMat2DRotate)
affine_trans_region (Region, RegionAffineTrans, HomMat2DRotate, 'nearest_neighbor')
move_region(RegionAffineTrans, RegionMoved2, -10, -10)
smallest_rectangle2(RegionMoved2, Row2, Column2, Phi2, Length12, Length22)
gen_rectangle2(Rectangle2, Row2, Column2, Phi2, Length12, Length22)
*先旋转再平移
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_rotate (HomMat2DIdentity, 0.2, -100, -100, HomMat2DRotate)
hom_mat2d_translate(HomMat2DRotate, 10, 10, HomMat2DTranslate)
affine_trans_region (Rectangle2, RegionAffineTrans2, HomMat2DRotate, 'nearest_neighbor')
<

这篇博客通过Halcon演示了如何进行矩阵旋转和平移操作,首先展示了先旋转后平移的矩阵变换,然后解释了先平移后旋转的效果,并探讨了不同旋转中心对结果的影响,提供了具体的代码示例。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



