1、官方例程

C:\Users\Public\Documents\MVTec\HALCON-18.11-Progress\examples\hdevelop\Tools\Grid-Rectification\

gen_arbitrary_distortion_map.hdev
grid_rectification.hdev

2、算子说明

connect_grid_points

功能:建立矫正网格的矫正点间的连接。

create_rectification_grid

功能:建立一个附文件,描述矫正网格。

find_rectification_grid

功能:分割图像中矫正网格区域。

gen_arbitrary_distortion_map

功能:产生一个投射图,其描述随意扭曲图像与正确图像间的映射。

gen_grid_rectification_map

功能:计算扭曲图像与基于规律的网格的正确的图像的映射。

3、源码grid_rectification.hdev

* 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 := 17
create_rectification_grid (WidthOfGrid, NumSquares, 'rectification_grid.ps')
*
* 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 := 10
find_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 := 5
saddle_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 map
gen_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之畸变标定Grid-Rectification相关推荐

  1. Halcon单相机标定—标定板标定和自标定 线扫相机标定

    一.标定板标定 13.0 ************************************************************************************* * ...

  2. Halcon :畸变矫正与标定(2)

    相机标定 1.相机标定是什么 2.怎么使用halcon进行相机内外参标定? (1)搭建硬件 1.**相机连好电脑,用相机厂家软件打开相机,检查一下相机是否正常.** 2.**接下来使用halcon连接 ...

  3. Halcon: 畸变矫正与标定(1)

    1. Halcon相机标定和图像矫正     对于相机采集的图片,会由于相机本身和透镜的影响产生形变,通常需要对相机进行标定,获取相机的内参或内外参,然后矫正其畸变.相机畸变主要分为径向畸变和切向畸变 ...

  4. Halcon 单目标定,畸变矫正,图像坐标系转世界坐标系

    代码为Halcon代码,只有代码以及解释,默认已经理解世界坐标系(WCS)到相机坐标系(CCS)到图像坐标系(ICS)到像素坐标系(PCS)转换 *********************1. 标定内 ...

  5. Halcon不使用标定板如何矫正畸变?

    源码来自: halcon学习网 read_image(Image,'C:/Users/firecat/Downloads/9_281_67b0b01ce3c865f.jpg') edges_sub_p ...

  6. Halcon 单相机标定

    原文链接:https://blog.csdn.net/weixin_43197380/article/details/90438976#comments_13104885 一.理论 为什么要进行单相机 ...

  7. HALCON单目标定

    标定之前需要提前准备好的是标定板(如果用笔记本电脑提前尝试但是没有标定板,下面有步骤会生成ps文件,可以自己打印出来试一试) HALCON有两种标定板 一种是老版的如下图 还有一种是新版的如下 我们要 ...

  8. Halcon:手眼标定——眼在手外与眼在手上

    为什么需要九点标定? 为了得到机械和相机的关系,就好比人的手和眼的关系.我们用手将一个物体放到空间的一个位置,用眼看到这个物体,这也存在两个坐标系,一个是手所在的运动空间的坐标系,一个是视网膜上成像的 ...

  9. halcon使用直线标定板,标定相机内参代码

    read_image (Image, '直线标定板图片/Left201118140641772.bmp') get_image_size (Image, Width, Height) dev_clos ...

最新文章

  1. Win7碎片整理在哪?
  2. 第一周周四DailyReporting——PM(李忠)
  3. leetcode算法题--回文子串
  4. megacli通过盘符定位物理盘_柴少鹏的官方网站
  5. Linux(四) 用户、用户组
  6. SonarQube6.2源码解析(三)
  7. 使用ABAP memory inspector分析product 搜索内存占用
  8. c语言编程基础课件,第7章_C语言图形编程基础课件
  9. mysql用户阻塞数_MySQL实例阻塞分析一例(线程statistics状态)
  10. 大数据就业前景分析的太到位了【附:1T视频资料】
  11. Python机器学习:SVM008scikit-learn中的高斯核函数
  12. 区块链的5大安全风险
  13. hibernate映射文件出现should be mapped with insert=“false“ update=“false“
  14. 马士兵oracle_,马士兵oracle视频教程学习笔记个人整理
  15. 密立根油滴实验的c语言程序,密立根油滴实验数据处理程序c++
  16. SQL --用户数据维护
  17. 2021年3月16刚进新公司做了四天就被劝退
  18. 计算机网络-网络应用(上)
  19. 计算机专业基础需要注意的点
  20. 1. 目标精通--用java写设计模式:单一职责原则

热门文章

  1. 2021年茶艺师(中级)考试及茶艺师(中级)考试题库
  2. 在TCP/IP网络中,为各种公共服务保留的端口号范围
  3. JavaScript-238:筋斗云案例
  4. jqprint打印时自定义页眉页脚
  5. Android require a foreground service of type ServiceInfo.FOREGROUND_SERVICE
  6. DefaultCPUAllocator: not enough memory: you tried to allocate
  7. AD PCB布局拖动元器件时出现的红线、绿线(Optimal Placement Vector)
  8. Caffeine Cache
  9. 本地缓存框架:Caffeine Cache
  10. coroutine 携程与定时一起混用