halcon二 图像校正
1.get_image_size(Image : : : Width, Height)
返回图像的尺寸。
2.parameters_image_to_world_plane_centered (CamParam, Pose, CenterRow, CenterCol, WidthMappedImage, HeightMappedImage, ScaleForCenteredImage, PoseForCenteredImage)
Halcon内部程序,输出为图像的比率和姿态。
3.gen_image_to_world_plane_map( : Map : CameraParam, WorldPose, WidthIn, HeightIn,WidthMapped, HeightMapped, Scale, MapType : )
产生一个投影映射,该映射描述图像平面与Z=O的世界平面之间的关系,输出为图像MAP,是一个多通道的图像
包含了映射数据。
4.map_image(Image, Map : ImageMapped : : )
利用映射变换校正图像,输出为矫正后的图像。
5.image_to_world_plane(Image : ImageWorld : CameraParam, WorldPose, Width, Height, Scale,Interpolation : )
把校正后的图像转换到Z=0的世界平面。
6.image_points_to_world_plane( : : CameraParam, WorldPose, Rows, Cols, Scale : X, Y)
把图像上的点转换到Z=0的世界平面,输出为点坐标。
* This program provides procedures for the determination of the
* parameters Pose and Scale of the operators image_to_world_plane
* and gen_image_to_world_plane_map.
*
* Read the image
ImgPath := '3d_machine_vision/calib/'
read_image (Image, ImgPath+'caliper_01')
* Set the camera parameters for the image
CamParam := [0.0160728,-631.843,7.40077e-006,7.4e-006,326.369,246.785,652,494]
Pose := [-41.2272,26.763,398.682,359.655,359.202,322.648,0]
* Reopen the window appropriately
get_image_size (Image, WidthOriginalImage, HeightOriginalImage)
dev_open_window_fit_image (Image, 0, 0, WidthOriginalImage, HeightOriginalImage, WindowHandle)
set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
dev_set_color ('red')
WidthMappedImage := 652
HeightMappedImage := 494
* Transform the image such that a given point appears in the
* center of the rectified image and the the scale of the rectified image
* is similar to the scale of the original image (in the surroundings
* of the given point)
* Define the point that will appear in the center of the rectified image
dev_display (Image)
disp_message (WindowHandle, 'Define the center of the mapped image', 'window', 12, 12, 'white', 'false')
get_mbutton (WindowHandle, CenterRow, CenterCol, Button)
* Determine scale and pose such that the given point appears
* in the center of the rectified image and that the
* scale of the two images is similar (in the surroundings
* of the given point).
parameters_image_to_world_plane_centered (CamParam, Pose, CenterRow, CenterCol, WidthMappedImage, HeightMappedImage, ScaleForCenteredImage, PoseForCenteredImage)
* Rectify the image
gen_image_to_world_plane_map (Map, CamParam, PoseForCenteredImage, WidthOriginalImage, HeightOriginalImage, WidthMappedImage, HeightMappedImage, ScaleForCenteredImage, 'bilinear')
map_image (Image, Map, ImageMapped)
dev_open_window_fit_image (ImageMapped, 0, 0, WidthMappedImage, HeightMappedImage, WindowHandleMapped)
set_display_font (WindowHandleMapped, 14, 'mono', 'true', 'false')
dev_set_color ('red')
dev_display (ImageMapped)
* In case, only one image has to be mapped, the operator
* image_to_world_plane can be used instead of the operators
* gen_image_to_world_plane_map together with map_image.
image_to_world_plane (Image, ImageMapped, CamParam, PoseForCenteredImage, WidthMappedImage, HeightMappedImage, ScaleForCenteredImage, 'bilinear')
* Display the center point
image_points_to_world_plane (CamParam, PoseForCenteredImage, CenterRow, CenterCol, ScaleForCenteredImage, CenterX, CenterY)
disp_cross (WindowHandleMapped, CenterY, CenterX, 6, rad(45))
disp_message (WindowHandleMapped, 'The selected point appears in the center', 'window', 12, 12, 'white', 'false')
disp_message (WindowHandleMapped, 'of the rectified image', 'window', 36, 12, 'white', 'false')
disp_continue_message (WindowHandleMapped, 'black', 'true')
stop ()
*
* Now determine scale and pose such that the entire image
* fits into the rectified image.
parameters_image_to_world_plane_entire (Image, CamParam, Pose, WidthMappedImage, HeightMappedImage, ScaleForEntireImage, PoseForEntireImage)
* Rectify the image
image_to_world_plane (Image, ImageMapped, CamParam, PoseForEntireImage, WidthMappedImage, HeightMappedImage, ScaleForEntireImage, 'bilinear')
dev_clear_window ()
dev_display (ImageMapped)
disp_message (WindowHandleMapped, 'The entire image is visible in the rectified image', 'window', -1, -1, 'white', 'false')
halcon二 图像校正的更多相关文章
- 采用QHD分辨率使用kinect2_calibration,完成QHD图像校正
//.................................................................................//采用QHD分辨率使用kinec ...
- Halcon二维仿射变换实例探究
二维仿射变换,顾名思义就是在二维平面内,对对象进行平移.旋转.缩放等变换的行为(当然还有其他的变换,这里仅论述这三种最常见的). Halcon中进行仿射变换的常见步骤如下: ① 通过hom_mat2d ...
- 三维重建:QT+OpenNI+Kinect图像校正
后记: 当时能不放弃这个方向是因为这里面涉及了一种很有效的三位场景存储方式,可能给出除图元建模之外的一种三维场景描述方式.这和Flash与位图的对比一样,基于图元的flash始终抵不过基于点描述的位图 ...
- vs联合halcon——采集图像(实时采集与单次采集)
摘要 在对vs进行环境配置好以后,就可以开始与halcon联合进行实战.本篇就对图像的采集进行总结.通过构建采集相机GrabImage类的三个方法实现图像的采集: open() 打开相机 grabim ...
- php excel文件导出之二 图像导出
PHP文件导出 之图像 和 文字同一时候导出 事实上之前写了个php文件导出.跟这个极为相似,由于项目须要对图像进行导出.查询一番.又写了一个, 这个能实现图像的导出(仅仅能是本地图像,不能使用远程图 ...
- Halcon采集图像Image Acquisition解析
很明显,图像的采集是所有机器视觉应用中必须解决的问题,HALCON提供了为各种图像采集设备执行这种交互的接口,图像采集的任务被简化为几行代码,只需几个操作符的调用,更重要的是,这种简单并不是以限制可用 ...
- Halcon的二维码解码步骤和解码技巧
一.二维码简介 1 . 类型多样,常见的有QR Code二维码. Data Matrix二维码等. 2.高密度编码,信息容量大. 3.容错能力强,具有纠错功能:二维码因穿孔.污损等引起局部损坏时,照样 ...
- Halcon的C#二次开发及经验分享
本文涉及面较广,因此很难在所有方面都讲解得很详细,故适合具有一定Halcon开发经验的人阅读. 1.Halcon二次开发的两种方式 ① 使用C#的语法方式逐句改写Halcon代码 优点:各种变量的类型 ...
- 分享吉林大学机械科学与工程学院,zhao jun 博士的Halcon学习过程及知识分享
分享吉林大学机械科学与工程学院,zhao jun 博士的Halcon学习过程及知识分享 全文转载zhao jun 博士的新浪博客,版权为zhaojun博士所有 原文地址:http://blog.sin ...
随机推荐
- Array对象常用方法
不改变原数组: 1.concat() 连接两个或多个数组 不改变原数组 返回被连接数组的一个副本 2.join() 把数组中所有元素放入一个字符串 不改变原数组 返回字符串 3.slice() ...
- Java基础面试题(Hibernate)
Hibernate是一个什么样的框架? Hibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,它将POJO与数据库表建立映射关系,是一个全自动的orm框架,hi ...
- linux批量远程多服务器FTP并下载文件的脚本
#!/bin/bashtime=`date +%Y%m`day=`date -d '-1 days' +%Y%m%d`localDir="/DBBackup/GameDB"cd $ ...
- JWinner:一个私人定制的快速开发框架,为理想而生
关于JWinner JWinner是一个JAVA项目的快速开发框架,他已经实现了大多数项目开发之前需要进行的一些必备工作,还有很多在开发过程中可能会用到的工具集. JWinner的诞生并不是一蹴而就的 ...
- 【转】使用URL SCHEME启动天猫客户端并跳转到某个商品页面的方法
在项目中遇到了这样一个需求:让用户在手机应用中,点击一个天猫的商品链接(知道商品在PC浏览器里的地址),直接启动天猫的客户端并显示这个商品.以前曾经实现过类似的功能,不过那次是淘宝的商品,天猫和淘宝的 ...
- Java并发编程--1.Thread和Runnable
创建线程 Java有两种方式创建线程, 继承Thread类和实现Runnable接口 继承Thread 步骤: 1.自定义一个类继承Thread类, 重写run方法 2.创建自定义类的对象,调用sta ...
- Windows10中以管理员身份打开命令提示符
WIN+X+A (要关闭替换) 从任务栏启动 从开始菜单 从资源管理器 连贯即(alt+f+s+a)
- Redis——总结
启动 redis 客户端,打开终端并输入命令 redis-cli.该命令会连接本地的 redis 服务. $redis-cli redis 127.0.0.1:6379> redis 127.0 ...
- MySQL插入emoji表情失败问题的解决方法
前言 之前一直认为UTF-8是万能的字符集问题解决方案,直到最近遇到这个问题.最近在做新浪微博的爬虫, 在存库的时候发现只要保持emoji表情,就回抛出以下异常: Incorrect string v ...
- 使用CSS3的“transition ”属性控制长宽度的缓慢变化
有时候我们可能会想要改变某个资源信息的长宽度,比如改变某个div的宽度,而且需要让这个宽度缓慢改变,而不是突然就改变了.这时候你可能会想到使用jquery的animate()函数,不过这个方法既得引用 ...