Halcon的图像获取的实例
2014-04-19 18:17
267 查看
重新整理之前旧网站上发布过的帖子。
比较常用的几个图像获取的例子,之前刚刚学习halcon的时候写的,作为入门的第一步,还是值得再分享一下的。
*=================分割线1==================
*图像获取的基本代码(1)
*读取路径下的图片,image1
read_image(image1,'F:/Halcon test/barcode/image/1.png')
比较常用的几个图像获取的例子,之前刚刚学习halcon的时候写的,作为入门的第一步,还是值得再分享一下的。
*=================分割线1==================
*图像获取的基本代码(1)
*读取路径下的图片,image1
read_image(image1,'F:/Halcon test/barcode/image/1.png')
*=================分割线2================== *图像获取的基本代码(2) *读取路径下的多张图片,image2 imagepath :=[] *建立一个图像读取的数组,命名为imagepath。 imagepath[0]:='F:/Halcon test/barcode/image/2.png' imagepath[1]:='F:/Halcon test/barcode/image/3.png' imagepath[2]:='F:/Halcon test/barcode/image/4.png' imagepath[3]:='F:/Halcon test/barcode/image/5.png' *读取4张图片的路径 for i:=0 to 3 by 1 read_image(image2,imagepath[i]) endfor
*=================分割线3================== *图像获取的基本代码(3) *读取文件夹下的某些图片,image3 for i:=1 to 5 by 1 read_image(image3,'F:/Halcon test/barcode/image/'+i+'.png') endfor
*=================分割线4================== *图像获取的基本代码(4) *读取文件夹下的所有图片和文件夹,image4 * Code generated by Image Acquisition 01 list_files ('F:/Halcon test/barcode/image', ['files','directories','recursive','max_depth 2','follow_links'], ImageFiles) tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima)$','ignore_case'], ImageFiles) *'ignore_case':忽略大小写 *'\\.' --> '.' for Index := 0 to |ImageFiles| - 1 by 1 read_image (Image4, ImageFiles[Index]) * Do something endfor
*=================分割线5================== *图像获取的基本代码(5) *连接摄像机读取图像,image5 * Code generated by Image Acquisition 02 open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '0', -1, -1, AcqHandle) grab_image_start (AcqHandle, -1) while (true) grab_image_async (Image5, AcqHandle, -1) * Do something endwhile close_framegrabber (AcqHandle)
相关文章推荐
- Halcon的图像获取的实例
- Halcon学习之二:摄像头获取图像和相关参数
- WPF实例秀——如何获取UI元素的图像 推荐
- Halcon一日一练:获取图像属性
- Halcon学习之二:摄像头获取图像和相关参数
- WPF实例秀——如何获取UI元素的图像
- Halcon学习之六:获取Image图像中Region区域的特征参数
- C# 使用Sentech相机sdk 获取图像,转换为halcon HImage的两种方法
- Halcon学习之二:摄像头获取图像和相关参数
- Halcon学习之六:获取Image图像中Region区域的特征参数
- Halcon中自动获取视频图像信息(实时显示)步骤
- Halcon学习之六:获取Image图像中Region区域的特征参数
- HALCON不支持的设备中,获取图像
- Java获取彩色图像中的主色彩的实例代码
- Halcon学习(二)图像获取与相关参数
- Halcon:获取Image图像中Region区域的特征参数
- Halcon代码实现背景减除法获取运动图像前景
- php 5.6获取mongodb实例
- Java获取数字中单个数字,实例 获取水仙花数
- 获取当前应用程序实例(instance:HINSTANCE)