当前位置:网站首页>Halcon affine transformations to regions

Halcon affine transformations to regions

2022-07-05 08:40:00 Aii parson

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 window
draw_region (Region, WindowID)# Draw by hand , Right click OK
hom_mat2d_identity (HomMat2DIdentity)#3 Dimensional unit matrix
hom_mat2d_rotate (HomMat2DIdentity, -0.3, 256, 256, HomMat2DRotate)# Rotation matrix , Clockwise is negative ; Around the (256,256) The coordinates rotate clockwise 0.3 radian .
hom_mat2d_scale (HomMat2DRotate, 1.5, 1.5, 256, 256, HomMat2DScale)# Zoom matrix , Around the (256,256) coordinate ,x Direction and y Zoom in all directions 1.5 times
affine_trans_region (Region, RegionAffineTrans, HomMat2DScale, 'nearest_neighbor')# Perform affine transformation of adjacent interpolation
dev_clear_window ()
dev_set_draw ('margin')
dev_set_color ('red')
dev_display (Region)
# The original picture
dev_set_color ('green')
dev_display (RegionAffineTrans)
# Affine graph

The original picture

Affine graph

  original VS Affine contour

原网站

版权声明
本文为[Aii parson]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140541151381.html