网格校正的步骤:
create_rectification_grid

  • 生成一个PostScript文件,该文件描述纠正网格。

find_rectification_grid
find_rectification_grid(Image : GridRegion : MinContrast, Radius : )

  • 在图像中分割校正网格区域。
    在图像图像中搜索包含整流网格的图像部分,并将它们返回到GridRegion区域。为了做到这一点,本质上,提取对比度至少为MinContrast的图像区域,并填充这些区域中的孔。然后,一个半径为Radius的开口应用于这些区域,以消除较小的区域的高对比度

saddle_points_sub_pix

  • 图像鞍点的亚像素精确检测。
    saddle_points_sub_pix特别适用于检测角点,在角点处,不同强度的字段连接在一起,就像棋盘上的黑白字段一样。它们的高对比度和形状便于定位和确定这些角的精确位置。

connect_grid_points

  • 建立整流网格各网格点之间的连接。

gen_grid_rectification_map
*基于规则网格上的点计算畸变图像与校正图像之间的映射。

map_image
*校正图像

网格校正例程

* This example illustrates how to use the operators for the grid-rectification.
*
* The following command creates a postscript file
* that contains the rectification grid. This grid must be
* printed. Then it must be mounted on the object surface.
WidthOfGrid := 0.17
NumSquares := 17create_rectification_grid (WidthOfGrid, NumSquares, 'rectification_grid.ps')
* 生成一个PostScript文件,该文件描述纠正网格。* Read the image of the object wrapped by the rectification grid
* and reopen the window with an appropriate size.
read_image (Image, 'can_with_grid')
get_image_size (Image, ImageWidth, ImageHeight)
dev_close_window ()
dev_open_window (0, 0, ImageWidth * 0.75, ImageHeight * 0.75, 'black', WindowID1)
dev_display (Image)
dev_update_off ()
set_display_font (WindowID1, 14, 'mono', 'true', 'false')
*
*
* Part 1: Determination of the image map
* The surface to be rectified is wrapped by a checkered pattern, which
* is used to determine the mapping between the distorted image and
* the rectified image. Note the orientation of the two circular marks. When
* in gen_grid_rectification_map() the parameter Rotation is 'auto', the rectified
* image is rotated such that the black mark is left of the white mark.
*
* Determine region of interest
MinContrast := 25
Radius := 10find_rectification_grid (Image, GridRegion, MinContrast, Radius)
* 在图像中分割校正网格区域。dev_display (GridRegion)
disp_message (WindowID1, 'Grid region', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowID1, 'black', 'true')
stop ()
reduce_domain (Image, GridRegion, ImageReduced)
*
* Determine grid points
SigmaSaddlePoints := 1.5
Threshold := 5saddle_points_sub_pix (ImageReduced, 'facet', SigmaSaddlePoints, Threshold, Row, Col)
* 图像鞍点的亚像素精确检测。dev_set_color ('blue')
gen_cross_contour_xld (SaddlePoints, Row, Col, 6, 0.785398)
dev_display (Image)
dev_display (SaddlePoints)
disp_message (WindowID1, 'Grid points', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowID1, 'black', 'true')
stop ()
*
* Connect points to grid
SigmaConnectGridPoints := 0.9
MaxDist := 5.0
GridSpacing := 20
dev_set_color ('red')connect_grid_points (ImageReduced, ConnectingLines, Row, Col, SigmaConnectGridPoints, MaxDist)
* 建立整流网格各网格点之间的连接。dev_display (ConnectingLines)
disp_message (WindowID1, 'Connected grid points', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowID1, 'black', 'true')
stop ()
*
* Determine image mapgen_grid_rectification_map (ImageReduced, ConnectingLines, Map, Meshes, GridSpacing, 0, Row, Col, 'bilinear')基于规则网格上的点计算畸变图像与校正图像之间的映射。
map_image (ImageReduced, Map, ImageMapped) 校正图像*
get_image_size (Map, MapWidth, MapHeight)
dev_open_window (0, (ImageWidth * 0.75) + 12, MapWidth, MapHeight, 'black', WindowID2)
set_display_font (WindowID2, 14, 'mono', 'true', 'false')
dev_display (ImageMapped)
disp_message (WindowID2, 'Rectified grid', 'window', 12, 12, 'black', 'true')
stop ()
*
*
* Part 2: Application of the image map
* The original surface (without the checkered pattern) is rectified
* using the previously calculated image map.
*
* Read in the image to be rectified
read_image (Image, 'can')
*
* Rectify image using the previously calculated image map
dev_set_window (WindowID2)
map_image (Image, Map, ImageMapped)
*
dev_set_window (WindowID1)
dev_display (Image)
disp_message (WindowID1, 'Original image', 'window', 12, 12, 'black', 'true')
dev_set_window (WindowID2)
dev_display (ImageMapped)
disp_message (WindowID2, 'Rectified image', 'window', 12, 12, 'black', 'true')

halcon学习-网格校正相关推荐

  1. Halcon学习笔记:select_points_object_model_3d(3D对象模型阀值分割)

    Halcon学习笔记:select_points_object_model_3d 3D对象模型阀值分割 This example program shows how to use the operat ...

  2. Halcon学习笔记:xyz_attrib_to_object_model_3d示例

    Halcon学习笔记:xyz_attrib_to_object_model_3d--从X.Y和Z图像中创建3D对象模型同时附加属性 xyz_attrib_to_object_model_3d.hdev ...

  3. Halcon学习笔记:1D Measuring一维测量_fuse.hdev灯丝测量示例

    Halcon学习笔记:1D Measuring一维测量_fuse.hdev灯丝测量示例 一.基本概念 基本流程为: 获取图像 对图像进行灰度值标定 (针对相机获取的图像灰度和输入能量之间的非线性关系, ...

  4. halcon例程讲解_跟我学机器视觉-HALCON学习例程中文详解-开关引脚测量

    跟我学机器视觉-HALCON学习例程中文详解-开关引脚测量 This example program demonstrates the basic usage of a measure object. ...

  5. 机器视觉-halcon学习笔记1

    德国的软件,傻瓜式安装,每月更新的licence:开发环境就配置好了. ps:软件可以直接在 halcon学习网上下载,18的版本就行. 这玩意有自带的脚本语言在halcon的开发环境IDE下写,写好 ...

  6. 随笔分类 - HALCON学习例程中文详解

    from: https://www.cnblogs.com/chita/category/563492.html 随笔分类 - HALCON学习例程中文详解 HALCON学习例程中文详解 跟我学机器视 ...

  7. Halcon学习笔记(三)---数据类型

    Halcon学习笔记(三)---数据类型 halcon只能在单独行进行注释,不能在语句后面进行注释. 1.tuple(元组,重数) 赋值符号":=" tuple算子: (1)变量定 ...

  8. Halcon学习笔记(一):Qt+Halcon联合开发配置

    Halcon学习笔记(1):Qt+Halcon联合开发配置 首先是新建一个QT项目qtest_hc 方法一: 1)QT项目文件 qtest_hc 添加库: #1.包含目录添加 INCLUDEPATH ...

  9. HALCON学习之旅(七)

    HALCON学习之旅(七) 文章目录 HALCON学习之旅(七) 1.MFC与Halcon混合编程 2.C#与Halcon混合编程 3.Halcon测量助手使用 4.Halcon实例进阶一(拟合区域椭 ...

  10. HALCON学习之旅(六)

    HALCON学习之旅(六) 文章目录 HALCON学习之旅(六) 1.Halcon代码如何导出高级编程语言代码 + 配置Halcon/C++编程环境 2.Halcon连续采集相机图像 3.Halcon ...

最新文章

  1. 李联宁|量子计算机:技术路线、风险及战略投资
  2. 重构-改善既有代码的设计 读书笔记
  3. CodeForces Gym-101350M
  4. 云炬创业政策学习笔记20210113
  5. mysql5.7.20linux安装,linux下 mysql5.7.20安装(精华)
  6. python os 文件锁_python 中给文件加锁——fcntl模块
  7. nginx 静态资源WEB服务
  8. (转)基于svnserve的服务器,权限文件authz配置的常见问题及解答
  9. jsp+servlet+java 实现统计在线人数
  10. 分布式数据流计算系统的数据缓存技术综述
  11. 小汤学编程之JAVA基础day15——枚举、注解和Properties
  12. 通用类 ExcelHelper Excel操作
  13. loadrunner压力测试一般使用流程
  14. 托福考试前你需要知道哪些事情
  15. android截屏保存目录,Android实现截屏,将截图文件保存到本地文件夹
  16. 腾格尔发新歌《遥远的地方》,成都邓秀菊自发红包朋友圈寻歌词
  17. 公共场合的wifi 靠不住
  18. 网页: 如何修改列表项 ul > li 前小圆点的样式
  19. 移动端h5页面软键盘弹出后 背景图片被顶上去
  20. ArrayList.add方法底层浅析

热门文章

  1. 冰点下载器手机版apk_冰点文库下载器
  2. UT斯达康首家手机网上专卖店落户淘宝网
  3. NLP 语料库 大全
  4. java 单元测试 网络请求_Spring Boot 系列(二)单元测试网络请求
  5. ntpdate从指定服务器同步时间,ntpdate:设置服务器时间定期同步
  6. python编程从入门到实践(第2版)第二章练习题解答
  7. ELAS_ROS算法在KITTI数据集上生成稠密点云
  8. 教材寻找 下载系列1
  9. 明华RD读卡器校验密码问题
  10. 最新新游社iApp源码+后台对接的hybbs内核