Hello Mat

 找回密码
 立即注册
查看: 9127|回复: 7

仿射变换:水平矫正

[复制链接]

1294

主题

1520

帖子

110

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22633
发表于 2020-2-22 12:01:45 | 显示全部楼层 |阅读模式
仿射变换:水平矫正,本例用于分析wafer的倾斜角度,wafer晶圆是一类特殊结构的obj;
  1. * 使用text_line_orientation算法矫正wafer角度
  2. *
  3. dev_update_off ()
  4. dev_close_window ()
  5. read_image (Image, 'wafer/wafer_rotated')
  6. dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
  7. set_display_font (WindowHandle, 10, 'mono', 'true', 'false')
  8. dev_set_draw ('margin')
  9. dev_display(Image)
  10. *
  11. * 初始化旋转中心
  12. RotCenterRow := 360.13
  13. RotCenterCol := 359.99
  14. gen_cross_contour_xld (Cross, RotCenterCol, RotCenterCol, 20, 0.785398)
  15. gen_rectangle1 (Rectangle, RotCenterRow - 55, RotCenterCol - 300, RotCenterRow + 55, RotCenterCol + 300)
  16. *
  17. * 使用text_line_orientation算法矫正wafer角度
  18. reduce_domain (Image, Rectangle, ImageReduced)
  19. text_line_orientation (Rectangle, ImageReduced, 25, rad(-30), rad(30), OrientationAngle)
  20. Angle := -deg(OrientationAngle)
  21. * correct the alignment
  22. rotate_image (Image, ImageRotate, Angle, 'constant')
  23. *
  24. * Display the results
  25. dev_clear_window ()
  26. dev_display (ImageRotate)
  27. dev_display (Cross)
  28. disp_message (WindowHandle, 'The wafer must be rotated by ' + Angle .2f' + '° \nto be correctly aligned', 'window', 12, 12, 'black', 'true')
复制代码



参考:
【1】频域自相关变换
【2】仿射变换hom_mat2d_identity

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-4-25 20:37 , Processed in 0.240087 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表