*此例子将图中没有偏移的形状参照旋转的形状进行旋转
if (1)
angle:=-94.6606
else
angle:=94.6606
endif
dev_set_draw ('margin')
gen_rectangle2 (Regions, 332.818, 242.397, rad(angle), 143.871, 134.847)
*计算区域斜率
orientation_region (Regions, Phi)
*获取没有旋转的矩形
area_center (Regions, NULL, Row, Column)
*创建变换模型
vector_angle_to_rigid (Row, Column, Phi, Row, Column, 0, HomMat2D)
*区域变换
affine_trans_region (Regions, RegionAffineTrans, HomMat2D, 'nearest_neighbor')
dev_clear_window ()
dev_set_color ('green')
dev_display (Regions)
dev_set_color ('red')
dev_display (RegionAffineTrans)
halcon旋转区域测试
最新推荐文章于 2024-07-07 09:11:03 发布