将一张图像绕固定点 P 点 (100,100) 旋转固定角度

在 Halcon 中,将一张图像绕固定点 P 点 (100,100) 旋转固定角度操作:

* read_image (Image, 'image.bmp')
*制作旋转图片
* rotateTimes:=36
* pi:=rad(360)
* rotateAngle:=pi / rotateTimes

* hom_mat2d_identity (HomMat2DIdentity)
* for Index := 0 to 99 by 1
*     angle:=rotateAngle * Index
*     if (angle > pi)
*         break
*     endif
*     hom_mat2d_rotate (HomMat2DIdentity, angle, 863.281,1061.81, HomMat2DRotate)
*     affine_trans_image (Image, ImageAffineTrans, HomMat2DRotate, 'bilinear', 'false')
*     write_image (ImageAffineTrans, 'bmp', 0, 'image_'+(Index+1000)+'.bmp')
*     dev_clear_window ()
*     dev_display (ImageAffineTrans)
*     wait_seconds (0.1)
* endfor

 

posted @ 2025-05-10 11:50  .五十米深蓝  阅读(21)  评论(0)    收藏  举报